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

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% block stylesheet %}
  9.     <link rel="stylesheet" href="{{ asset('assets/css/stock-photo/main_module.css', 'user_data') }}">
  10.     <link rel="stylesheet" href="{{ asset('assets/css/stock-photo/header_style.css', 'user_data') }}">
  11.     {#<link rel="stylesheet" href="{{ asset('assets/css/page/header_stock_photo.css', 'user_data') }}">#}
  12. {% endblock %}
  13. {% block javascript %}
  14.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  15.     <script src="{{ asset('assets/js/header.js', 'user_data') }}"></script>
  16.     
  17.     <script>
  18.         document.addEventListener('DOMContentLoaded', function() {
  19.             if (window.innerWidth <= 768) {  // スマホサイズ判定
  20.                 const navLinks = document.querySelectorAll('.ec-categoryNaviRole .ec-itemNav__nav > li > a');
  21.         
  22.                 navLinks.forEach(function(link) {
  23.                     link.addEventListener('click', function(e) {
  24.                         // もし親liに「開くためのイベント」が登録されてるなら、それだけ止める
  25.                         e.stopPropagation(); // 親要素への伝播を止める(クリックイベントが親に届かない)
  26.                         // e.preventDefault() は書かない → これを書かないから「リンク移動はする」!!
  27.                     });
  28.                 });
  29.             }
  30.         });
  31.     </script>
  32.     
  33. {% endblock  %}
  34. <div class="fixed-header">
  35.     <section>
  36.     <div id="site_header">
  37.         <div class="header_logo">
  38.             <a href="{{url('photos')}}">
  39.                 <img src="{{ asset('assets/img/common/stock-photo_title1.svg', 'user_data') }}">
  40.             </a>
  41.         </div>
  42.         <div class="header_menus">
  43.             <div class="header_inner1">
  44.                 <div class="ec-headerSearch">
  45.                     <form method="get" class="search-form pc" action="{{ path('photo-product_list') }}#contents-list">
  46.                         <input type="search" name="name" maxlength="50" class="search-form-input" placeholder="キーワード(タイトル、著者など)を入力">
  47.                         <button type="submit" class="search-form-submit" aria-label="検索"></button>
  48.                     </form>
  49.                 </div>
  50.                 <div class="header_link1 pc">
  51.                     <ul class="link1">
  52.                         <li><a href="https://photo-pub.co.jp/news">NEWS</a></li>
  53.                         <li><a href="https://photo-pub.co.jp/company">会社概要</a></li>
  54.                         <li><a href="{{ url('contact') }}">お問い合わせ</a></li>
  55.                         <li><a href="{{ url('opinion') }}">意見箱</a></li>
  56.                     </ul>
  57.                 </div>
  58.                 <div class="header_link2">
  59.                     {{ include('Block/stockphoto_login.twig') }}
  60.                 </div>
  61.                 <div class="hamburger-menu sp">
  62.                     <button id="hamburger" class="hamburger">
  63.                         <span></span>
  64.                         <span></span>
  65.                         <span></span>
  66.                     </button>
  67.                     <nav id="menus" class="menus">
  68.                         <ul class="hamburger-tabs">
  69.                             <li class="menu-item">
  70.                                 <a href="{{ url('homepage') }}">TOP</a>
  71.                             </li>
  72.                             <li class="menu-item photo-pub">
  73.                                 <a href="{{ url('homepage') }}">フォトパブ堂書店</a>
  74.                                 <ul class="submenu">
  75.                                     <li><span></span><a href="{{ url('homepage') }}books">  フォトパブ堂書店TOP</a></li>
  76.                                     {% set AllCategories = repository('Eccube\\Entity\\Category').getList() %}
  77.                                     {% set Categories = AllCategories|filter(c => c.id is not null and c.id == 1) %}
  78.                                     {% for Category in Categories %}
  79.                                         {% for Child in Category.Children %}
  80.                                             <li>
  81.                                                 <span><a href="{{ url('product_list') }}?category_id={{ Child.id }}">{{ Child }}</a></span>
  82.                                             </li>
  83.                                         {% endfor %}
  84.                                     {% endfor %}
  85.                                 </ul>
  86.                             </li>
  87.                             <li class="menu-item">
  88.                                 <a href="{{ url('homepage') }}">フォトパブ写真館</a>
  89.                                 <ul class="submenu">
  90.                                     <li><span></span><a href="{{ url('homepage') }}photos">  フォトパブ写真館TOP</a></li>
  91.                                     {% set AllCategories = repository('Eccube\\Entity\\Category').getList() %}
  92.                                     {% set Categories = AllCategories|filter(c => c.id is not null and c.id == 6) %}
  93.                                     {% for Category in Categories %}
  94.                                         {% for Child in Category.Children %}
  95.                                             <li>
  96.                                                 <span><a href="{{ url('photo-product_list') }}?category_id={{ Child.id }}">{{ Child }}</a></span>
  97.                                             </li>
  98.                                         {% endfor %}
  99.                                     {% endfor %}
  100.                                 </ul>
  101.                             </li>
  102.                             <li class="menu-item">
  103.                                 <a href="https://jihi.photo-pub.co.jp/">自費出版サービス</a>
  104.                                 <ul class="submenu">
  105.                                     <li><span></span><a href="https://jihi.photo-pub.co.jp/">自費出版について</a></li>
  106.                                     <li><span></span><a href="https://jihi.photo-pub.co.jp/calc.php">自動見積もり</a></li>
  107.                                     <li><span></span><a href="https://jihi.photo-pub.co.jp/qanda.php">出版までの流れ</a></li>
  108.                                     <li><span></span><a href="https://jihi.photo-pub.co.jp/inquiry">自費出版に関するご相談</a></li>
  109.                                 </ul>
  110.                             </li>
  111.                             <li class="menu-item">
  112.                                 <a href="https://photo-pub.co.jp/event">イベント情報</a>
  113.                                 <ul class="submenu">
  114.                                     <li><span></span><a href="https://photo-pub.co.jp/event">イベント一覧</a></li>
  115.                                 </ul>
  116.                             </li>
  117.                             <li class="menu-item">
  118.                                 <a href="https://photo-pub.co.jp/recruit">各種募集</a>
  119.                                 <ul class="submenu">
  120.                                     <li><span></span><a href="https://photo-pub.co.jp/recruit">募集一覧</a></li>
  121.                                 </ul>
  122.                             </li>
  123.                         </ul>
  124.                         <ul class="hamburger-links">
  125.                             <li><a href="https://photo-pub.co.jp/news">NEWS</a></li>
  126.                             <li><a href="https://photo-pub.co.jp/company">会社概要</a></li>
  127.                             <li><a href="{{ url('contact') }}">お問い合わせ</a></li>
  128.                             <li><a href="{{ url('opinion') }}">意見箱</a></li>
  129.                             <li><a href="{{url('help_privacy')}}">プライバシー<br class="br_linkbox">ポリシー</a></li>
  130.                             <li><a href="{{url('help_tradelaw')}}">特定商取引法<br class="br_linkbox">に基づく表記</a></li>
  131.                         </ul>
  132.                         <ul class="hamburger-sns">
  133.                             <li><a><img src="{{ asset('assets/img/common/sns_ic_insta.png', 'user_data') }}" alt="insta"></a></li>
  134.                             <li><a href="https://www.youtube.com/@%E3%83%95%E3%82%A9%E3%83%88%E3%83%91%E3%83%96"><img src="{{ asset('assets/img/common/sns_ic_youtube.svg', 'user_data') }}" alt="youtube"></a></li>
  135.                             <li><a href="https://twitter.com/share?url=https://photo-pub.co.jp/&via=photopub402&hashtags=%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%95%E3%82%A9%E3%83%88%E3%83%91%E3%83%96%E3%83%AA%E3%83%83%E3%82%B7%E3%83%B3%E3%82%B0&text=%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%95%E3%82%A9%E3%83%88%E3%83%91%E3%83%96%E3%83%AA%E3%83%83%E3%82%B7%E3%83%B3%E3%82%B0"><img src="{{ asset('assets/img/common/sns_ic_x.svg', 'user_data') }}" alt="x"></a></li>
  136.                             <li><a href="http://www.facebook.com/share.php?u=https://photo-pub.co.jp/"><img src="{{ asset('assets/img/common/sns_ic_fb.svg', 'user_data') }}" alt="fb"></a></li>
  137.                         </ul>
  138.                     </nav>
  139.                 </div>
  140.             </div>
  141.             <div class="header_inner2 pc">
  142.                 <ul class="select_btns">
  143.                     <li class="btn"><a href="{{ url('homepage') }}">TOP</a></li>
  144.                     <li class="btn"><a href="{{ url('homepage') }}books">フォトパブ堂書店</a></li>
  145.                     <li class="btn"><a href="{{ url('homepage') }}photos">フォトパブ写真館</a></li>
  146.                     <li class="btn"><a href="http://jihi.photo-pub.co.jp/">自費出版サービス</a></li>
  147.                     <li class="btn"><a href="https://photo-pub.co.jp/event">イベント情報</a></li>
  148.                     <li class="btn"><a href="https://photo-pub.co.jp/recruit">各種募集</a></li>
  149.                 </ul>
  150.             </div>
  151.         </div>
  152.     </div>
  153.     <div class="tabs">
  154.         <ul class="tabs_inner">
  155.             {% set AllCategories = repository('Eccube\\Entity\\Category').getList() %}
  156.             {% set Categories = AllCategories|filter(c => c.id is not null and c.id == 6) %}
  157.             <div class="ec-categoryNaviRole">
  158.                 <div class="ec-itemNav">
  159.                     <ul class="ec-itemNav__nav">
  160.                         {% for FirstCategory in Categories %}
  161.                             {% for SecondCategory in FirstCategory.children %}
  162.                                 <li>
  163.                                     <a href="{{ url('photo-product_list') }}?category_id={{ SecondCategory.id }}">
  164.                                         {{ SecondCategory.name }}
  165.                                     </a>
  166.                                 </li>                                
  167.                             {% endfor %}
  168.                         {% endfor %}
  169.                     </ul>
  170.                 </div>
  171.             </div>
  172.         </ul>
  173.     </div>
  174.     <div class="sp-search-form">
  175.         <form action="{{ path('photo-product_list') }}#contents-list" class="search-form sp">
  176.             <input type="search" name="name" maxlength="50" class="search-form-input" placeholder="キーワード(タイトル、著者など)を入力">
  177.             <button type="submit" class="search-form-submit" aria-label="検索"></button>
  178.         </form>
  179.     </div>
  180. </section>
  181. </div>
  182. <style>
  183.     .fixed-header {
  184.     position: fixed;
  185.     top: 0;
  186.     left: 0;
  187.     width: 100%;
  188.     z-index: 9999;
  189.     background-color: #fff; /* 背景が透けないように */
  190.     box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 任意:影で浮かせる */
  191.     }
  192.     
  193.     body {
  194.         padding-top: 150px; /* ヘッダーの高さに合わせて調整(例:80px) */
  195.     }
  196. @media screen and (max-width: 820px) {
  197.     body {
  198.         padding-top: 180px; /* ヘッダーの高さに合わせて調整(例:80px) */
  199.     }
  200. }
  201. </style>