{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% set categories = [
{
'name':'CONCEPT',
'href':'/help/about',
},
{
'name':'LINE UP',
'href':'/products/list',
},
{
'name':'海洋散骨',
'href':'/sea_burial',
},
{
'name':'SPECIAL',
'href':'/special',
},
{
'name':'ニュース',
'href':'/news',
},
{
'name':'ご利用ガイド',
'href':'/guide',
},
{
'name':'お問い合わせ',
'href':'/contact/other',
}
] %}
{% block stylesheet %}{% endblock %}
{% set isSeaBurialUrl = app.request.pathInfo == '/sea_burial' %}
{% block javascript %}
{# ハンバーガーメニュー開閉の処理 #}
<script>
$(document).ready(function () {
$(".navigation").hide();
$(function () {
$('.js-hamburger-menu').on('click', function () {
$('.navigation').slideToggle(500)
});
});
});
</script>
{% if isSeaBurialUrl %}
<script>
var headerIcons = [
{
id: "logo",
before: "/html/template/default/assets/img/logo.webp" ,
after: "/html/template/default/assets/img/logo-white.png",
},
{
id: "logoSp",
before: "/html/template/default/assets/img/logo.webp",
after: "/html/template/default/assets/img/logo-white.png",
},
{
id: "favorite",
before: "/html/template/default/assets/icon/favorite.svg",
after: "/html/template/default/assets/icon/favorite_white.svg",
},
{
id: "person",
before: "/html/template/default/assets/icon/person.svg",
after: "/html/template/default/assets/icon/person_white.svg",
},
{
id: "cart",
before: "/html/template/default/assets/icon/shopping_cart.svg",
after: "/html/template/default/assets/icon/shopping_cart_white.svg",
},
{
id: "hamburger",
before: "/html/template/default/assets/icon/hamburger.svg",
after: "/html/template/default/assets/icon/hamburger_white.svg",
}
];
$(document).ready(function () {
$(".change_text_color").addClass("text-white");
headerIcons.forEach(function(icon){
var iconElement = $('#'+ icon.id);
iconElement.attr('src',icon.after);
});
$(window).on("scroll", function () {
const sliderHeight = $(".first_view").height();
if (sliderHeight + 150 < $(this).scrollTop()) {
$(".change_text_color").removeClass("text-white");
headerIcons.forEach(function(icon){
console.log("test");
var iconElement = $('#'+ icon.id);
iconElement.attr('src',icon.before);
});
} else {
$(".change_text_color").addClass("text-white");
headerIcons.forEach(function(icon){
var iconElement = $('#'+ icon.id);
iconElement.attr('src',icon.after);
});
}
});
});
</script>
{% endif %}
{% if app.request.get('_route') != 'homepage' %}
<script>
$(document).ready(function(){
$('.js-sp-logo').removeClass('opacity-0');
$(".js-logo").removeClass('opacity-0');
});
</script>
{% endif %}
{% endblock javascript %}
{% block main %}
{{ include('Block/pagetop.twig') }}
<div class="change_text_color fixed w-full px-8 h-20 lg:h-16 py-4 lg:px-6 items-center flex justify-between whitespace-nowrap z-50 gap-4 top-0">
<a href="/" class="md:hidden">
<img src="{{asset('assets/img/logo.webp') }}"
id="logo" alt="" class="w-[162px] h-[48px] xl:w-[113px] xl:h-[33px] js-logo opacity-0 duration-700">
</a>
<a href="/" class="hidden md:block">
<img src="{{asset('assets/img/logo.webp') }}" id="logoSp" alt="" class="w-[162px] h-[48px] lg:w-[113px] lg:h-[33px] js-sp-logo">
</a>
<ul class="flex gap-10 lessThanXl:gap-7 text-sm leading-7 lg:hidden">
{% for category in categories %}
<li class="hover">
<a href={{category.href}}>{{category.name}}</a>
</li>
{% endfor %}
</ul>
<div class="flex items-center gap-4 text-[8px] leading-3 font-bold">
{% if is_granted('ROLE_USER') %}
<a href="/mypage/favorite" class="w-8 h-8 flex-col justify-center items-center flex gap-[6px] hover">
<img src="{{asset('assets/icon/favorite.svg')}}"
id="favorite" alt="ハートのアイコン" class="w-8 h-8">
<p class="lg:hidden">お気に入り</p>
</a>
{% endif %}
<a href="{% if is_granted('ROLE_USER') %} /mypage {% else %} /mypage/login {% endif %}" class="w-8 h-8 flex flex-col justify-center items-center gap-[6px] text-black hover">
<img src="{{asset('assets/icon/person.svg')}}"
id="person" alt="ログインのアイコン" class="w-8 h-8">
{% if is_granted('ROLE_USER') %}
<p class="change_text_color lg:hidden">マイページ</p>
{% else %}
<p class="change_text_color lg:hidden">ログイン</p>
{% endif %}
</a>
<a href="/cart" class="w-8 h-8 flex flex-col justify-center items-center gap-[6px] hover">
<img src="{{asset('assets/icon/shopping_cart.svg')}}"
id="cart" alt="カートのアイコン" class="w-8 h-8">
<p class="lg:hidden">カート</p>
</a>
{# ハンバーガー #}
<button class="js-hamburger-menu hover">
<img src="{{asset('assets/icon/hamburger.svg')}}"
id="hamburger" alt="ハンバーガーメニュー" class=" w-8 h-8 hidden lg:block">
</button>
</div>
</div>
<nav class="navigation hidden fixed top-0 right-0 z-50 w-full overflow-y-scroll h-screen ">
{{ include('hamburger.twig') }}
</nav>
{% endblock %}