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

Open in your IDE?
  1. {#
  2. /**
  3.  * SP専用ヘッダーブロック
  4.  * 768px以下で表示されるモバイル専用ヘッダー
  5.  */
  6. #}
  7. <style>
  8. /* SP専用ヘッダー(768px以下でのみ表示) */
  9. @media (max-width: 768px) {
  10.     .Logo-img{
  11.         width: 84px;
  12.     }
  13.     .sp-header {
  14.         display: flex;
  15.         align-items: center;
  16.         justify-content: space-between;
  17.         padding: 12px 16px;
  18.         background-color: #ffffff;
  19.         border-bottom: 1px solid #f0f0f0;
  20.         box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  21.         top: 0;
  22.         height: 64px;
  23.     }
  24.     
  25.     .sp-header__menu-wrapper {
  26.         display: flex;
  27.         flex-direction: column;
  28.         align-items: center;
  29.         text-decoration: none;
  30.         color: black;
  31.         transition: color 0.3s ease;
  32.         gap: 2px;
  33.     }
  34.     
  35.     .sp-header__menu-btn {
  36.         display: flex;
  37.         flex-direction: column;
  38.         justify-content: space-between;
  39.         width: 24px;
  40.         height: 18px;
  41.         background: none;
  42.         border: none;
  43.         cursor: pointer;
  44.         padding: 0;
  45.         margin-bottom: 2px;
  46.     }
  47.     
  48.     .sp-header__menu-btn span {
  49.         display: block;
  50.         width: 100%;
  51.         height: 2px;
  52.         background-color: currentColor;
  53.         border-radius: 1px;
  54.         transition: all 0.3s ease;
  55.     }
  56.     
  57.     .sp-header__menu-text {
  58.         font-size: 12px;
  59.         font-weight: 500;
  60.         line-height: 1;
  61.     }
  62.     
  63.     .sp-header__logo {
  64.         flex: 1;
  65.         display: flex;
  66.         justify-content: center;
  67.         align-items: center;
  68.     }
  69.     
  70.     .sp-header__logo a {
  71.         text-decoration: none;
  72.         color: #8B4513;
  73.         font-size: 20px;
  74.         font-weight: bold;
  75.         font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  76.         letter-spacing: 0.5px;
  77.     }
  78.     
  79.     
  80.     .sp-header__cart {
  81.         display: flex;
  82.         flex-direction: column;
  83.         align-items: center;
  84.         text-decoration: none;
  85.         color: black;
  86.         font-size: 12px;
  87.         font-weight: 500;
  88.         transition: color 0.3s ease;
  89.     }
  90.     
  91.     .sp-header__cart-icon {
  92.         width: 24px;
  93.         height: 24px;
  94.         margin-bottom: 2px;
  95.         fill: currentColor;
  96.     }
  97.     
  98.     .sp-header__cart-text {
  99.         line-height: 1;
  100.     }
  101.     
  102.     .sp-header__cart-count {
  103.         background-color: #D2691E;
  104.         color: white;
  105.         font-size: 12px;
  106.         font-weight: bold;
  107.         border-radius: 50%;
  108.         width: 18px;
  109.         height: 18px;
  110.         display: flex;
  111.         align-items: center;
  112.         justify-content: center;
  113.         position: absolute;
  114.         top: -8px;
  115.         right: -8px;
  116.         min-width: 18px;
  117.     }
  118.     
  119.     .sp-header__cart-wrapper {
  120.         position: relative;
  121.         display: flex;
  122.         align-items: center;
  123.     }
  124. }
  125. /* PC表示時は非表示 */
  126. @media (min-width: 769px) {
  127.     .sp-header {
  128.         display: none;
  129.     }
  130. }
  131. </style>
  132. <header class="sp-header">
  133.     <!-- ハンバーガーメニュー -->
  134.     <div class="sp-header__menu-wrapper">
  135.         <button class="sp-header__menu-btn" type="button">
  136.             <span></span>
  137.             <span></span>
  138.             <span></span>
  139.         </button>
  140.         <span class="sp-header__menu-text">メニュー</span>
  141.     </div>
  142.     
  143.     <!-- ロゴ -->
  144.     <div class="sp-header__logo">
  145.         <a href="{{ url('homepage') }}">
  146.             <img src="{{ asset('/html/user_data/ContentImg/iseya_logo.png') }}" alt="ショップロゴ" class="Logo-img">
  147.         </a>
  148.     </div>
  149.     
  150. <!-- カート -->
  151. <div class="sp-header__cart-wrapper">
  152.     <div class="sp-header__cart">
  153.         
  154.         <div style="position: relative;">{#
  155.             <svg class="sp-header__cart-icon" viewBox="0 0 24 24">
  156.                 <path d="M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L21.7 4H5.21l-.94-2H1zm16 16c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
  157.             </svg>
  158.         </div>#}
  159.                     {{ include('Block/cart.twig') }}
  160.         <span class="sp-header__cart-text">カート</span>
  161.     </div>
  162. </div>
  163. </header>