app/template/default/Block/eccube4_header_new.twig line 1

Open in your IDE?
  1. {% block stylesheet %}
  2. <style>
  3.     .popup_mypage {
  4.         font-size: small;
  5.         width: auto;
  6.         min-width: 100px;
  7.         padding: 10px;
  8.         display: none;
  9.         position: absolute;
  10.         line-height: 1.2;
  11.         top: 45px;
  12.         right:55px;
  13.         z-index: 15;
  14.         background: #fff;
  15.         border: #9ece7a solid 1px;
  16.         border-radius: 2px;
  17.         -webkit-border-radius: 2px;
  18.         -moz-border-radius: 2px;
  19.     }
  20.     .popup_mypage p:first-child {
  21.         line-height: 1.3;
  22.         margin-bottom: 0.5em;
  23.     }
  24.     .popup_cart {
  25.         font-size: small;
  26.         width: auto;
  27.         min-width: 120px;
  28.         padding: 10px;
  29.         display: none;
  30.         position: absolute;
  31.         top: 45px;
  32.         right:5px;
  33.         z-index: 15;
  34.         background: #fff;
  35.         border: #9ece7a solid 1px;
  36.         border-radius: 2px;
  37.         -webkit-border-radius: 2px;
  38.         -moz-border-radius: 2px;
  39.     }
  40.     .popup_cart .product_type {
  41.         margin-bottom: 5px;
  42.     }
  43.     .popup_cart div:last-child {
  44.         margin-bottom: 0;
  45.     }
  46.     .popup_mypage a,
  47.     .popup_cart a {
  48.         text-decoration: underline;
  49.     }
  50.     .popup_mypage h2,
  51.     .popup_cart h2 {
  52.         font-size: 1.2em;
  53.     }
  54.     .quantity,
  55.     .money {
  56.         font-size: 14px;
  57.         font-weight: bold;
  58.     }
  59. </style>
  60. {% endblock %}
  61. {% block javascript %}
  62. <script>
  63.     $(function() {
  64.         var $body = $('body');
  65.         var $window = $(window);
  66.         $window.on('scroll', function() {
  67.             var scrollTop = $window.scrollTop();
  68.             var windowWidth = $window.width();
  69.             // 画面幅が768px未満の場合
  70.             if (windowWidth < 768) {
  71.             if (scrollTop > 10) {
  72.                 if (!$body.hasClass('header-fixed')) {
  73.                 $body.addClass('header-fixed');
  74.                 }
  75.             } else {
  76.                 if ($body.hasClass('header-fixed')) {
  77.                 $body.removeClass('header-fixed');
  78.                 }
  79.             }
  80.             }
  81.             // 画面幅が768px以上の場合
  82.             else if (windowWidth < 880) {
  83.             if (scrollTop > 20) {
  84.                 if (!$body.hasClass('header-fixed')) {
  85.                 $body.addClass('header-fixed');
  86.                 }
  87.             } else {
  88.                 if ($body.hasClass('header-fixed')) {
  89.                 $body.removeClass('header-fixed');
  90.                 }
  91.             }
  92.             }
  93.         });
  94.         $window.on('load resize', function() {
  95.             var windowWidth = $window.width();
  96.             var scrollTop = $window.scrollTop();
  97.             // 画面幅が768px未満の場合
  98.             if (windowWidth < 768) {
  99.             if (scrollTop <= 10 && $body.hasClass('header-fixed')) {
  100.                 $body.removeClass('header-fixed');
  101.             }
  102.             }
  103.             // 画面幅が768px以上、880px未満の場合
  104.             else if (windowWidth < 880) {
  105.             if (scrollTop <= 20 && $body.hasClass('header-fixed')) {
  106.                 $body.removeClass('header-fixed');
  107.             }
  108.             } 
  109.             // 画面幅が880px以上の場合
  110.             else {
  111.             if ($body.hasClass('header-fixed')) {
  112.                 $body.removeClass('header-fixed');
  113.             }
  114.             }
  115.         });
  116.     });
  117. </script>
  118. {% endblock javascript %}
  119. {% set Carts = get_all_carts() %}
  120. {% set totalPrice = get_carts_total_price() %}
  121. {% set totalQuantity = get_carts_total_quantity() %}
  122. <div id="header_wrap" class="clearfix">
  123.     <div id="header">
  124.         <div class="only-pc__880">
  125.             <div class="header-top flex">
  126.                 <h1 id="site_description">学校保健、性教育、食教育、メンタルヘルスなど"健康教育"に関する書籍を発行している出版社です。</h1>
  127.                 <div class="header-top__list">
  128.                     <ul class="flex">
  129.                         <li class="contact-mail"><a href="{{ url('contact') }}" ><img src="{{ asset('assets/img/icon/icon_mail_red.png', 'user_data') }}" alt="メールフォームへ" />お問い合わせ</a></li>
  130.                         {% if is_granted('ROLE_USER') == true %}
  131.                             <li class="mypage-btn"><a href="{{ url('mypage') }}"><img src="{{ asset('assets/img/common/btn_mypage.png', 'user_data') }}" alt="マイページ">マイページ</a></li>
  132.                             <li class="login-btn"><a href="{{ url('logout') }}"><img src="{{ asset('assets/img/common/btn_logout.png', 'user_data') }}" alt="ログアウト">ログアウト</a></li>
  133.                         {% else %}
  134.                             <li class="mypage-btn"><a href="{{ url('entry') }}"><img src="{{ asset('assets/img/common/btn_mypage.png', 'user_data') }}" alt="会員登録">会員登録</a></li>
  135.                             <li class="login-btn"><a href="{{ url('mypage') }}"><img src="{{ asset('assets/img/common/btn_login.png', 'user_data') }}" alt="ログイン">ログイン</a></li>
  136.                         {% endif %}
  137.                         <li class="sns-link"><a href="https://twitter.com/higashiyama_pub" target="_blank"><img src="/html/user_data/assets/img/icon/icon_x.png" alt="公式X"></a></li>
  138.                         <li class="sns-link"><a href="https://www.instagram.com/higashiyama_pub" target="_blank"><img src="/html/user_data/assets/img/icon/icon_insta.png" alt="公式インスタグラム"></a></li>
  139.                         <li class="sns-link"><a href="https://www.youtube.com/channel/UCleuOBiUeXjnRTIOhC8-4YQ/featured" target="_blank"><img src="/html/user_data/assets/img/icon/icon_youtube.png" alt="youtube"></a></li>
  140.                         <li id="cart-btn"><a href="{{ url('cart') }}"><img src="{{ asset('assets/img/common/btn_cart.png', 'user_data') }}" alt="カート"><span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span></a></li>
  141.                     </ul>
  142.                     <div class="header-top__bottom">
  143.                         <div class="flex">
  144.                             <p class="contact-tel"><a href="tel:0758419278" ><img src="{{ asset('assets/img/icon/icon_tel_red.png', 'user_data') }}" alt="電話番号" />075-841-9278(平日9:00〜17:00)</a></p>
  145.                             {% if is_granted('ROLE_USER') == true %}
  146.                             <p class="welcome">ようこそ、{{ app.user.name01 }}{{ app.user.name02 }}様</p>
  147.                             {% else %}
  148.                             <p class="welcome">ようこそ、ゲスト様</p>
  149.                             {% endif %}
  150.                         </div>
  151.                     </div>
  152.                 </div>
  153.             </div>
  154.         </div>
  155.         <div class="header-menu flex">
  156.             <div class="ec-headerNavSP" id="trigger">
  157.                 <i class="fas fa-bars"></i>
  158.             </div>
  159.             <h2 id="site_logo">
  160.                 <a href="{{ url('homepage') }}">
  161.                     <img src="{{ asset('assets/img/common/logo.jpg', 'user_data') }}" alt="東山書房">
  162.                 </a>
  163.             </h2>
  164.             <div class="header_utility">
  165.                 <div class="header-btnicon only-sp__880">
  166.                     <ul class="flex">
  167.                         {% if is_granted('ROLE_USER') == true %}
  168.                             <li class="mypage-btn"><a href="{{ url('mypage') }}"><img src="{{ asset('assets/img/common/btn_mypage.png', 'user_data') }}" alt="マイページ"></a></li>
  169.                             <li class="login-btn"><a href="{{ url('logout') }}"><img src="{{ asset('assets/img/common/btn_logout.png', 'user_data') }}" alt="ログアウト"></a></li>
  170.                             <li id="cart-btn"><a href="{{ url('cart') }}"><img src="{{ asset('assets/img/common/btn_cart.png', 'user_data') }}" alt="カート"><span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span></a></li>
  171.                         {% else %}
  172.                             <li class="mypage-btn"><a href="{{ url('entry') }}"><img src="{{ asset('assets/img/common/btn_mypage.png', 'user_data') }}" alt="会員登録"></a></li>
  173.                             <li class="login-btn"><a href="{{ url('mypage') }}"><img src="{{ asset('assets/img/common/btn_login.png', 'user_data') }}" alt="ログイン"></a></li>
  174.                             <li id="cart-btn"><a href="{{ url('cart') }}"><img src="{{ asset('assets/img/common/btn_cart.png', 'user_data') }}" alt="カート"><span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span></a></li>
  175.                         {% endif %}
  176.                     </ul>
  177.                 </div>
  178.             </div>
  179.         </div>
  180.     </div>
  181. </div>