app/template/anivbtob/Block/slim_header.twig line 1

Open in your IDE?
  1. <header class="ec-headerRole">
  2. <!-- タイトル -->
  3. <h1 class="ec-headerTitle">
  4. <a href="{{ url('homepage') }}">{{ BaseInfo.shop_name }}</a>
  5. </h1>
  6. <!-- ログイン後に表示 -->
  7. {% if is_granted('ROLE_USER') %}
  8. <div class="ec-headerNaviRole">
  9.     <!-- カテゴリ -->
  10.     {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  11.     {% macro tree(Category) %}
  12.         {% from _self import tree %}
  13.         <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  14.             {{ Category.name }}
  15.         </a>
  16.         {% if Category.children|length > 0 %}
  17.             <ul>
  18.                 {% for ChildCategory in Category.children %}
  19.                     <li>
  20.                         {{ tree(ChildCategory) }}
  21.                     </li>
  22.                 {% endfor %}
  23.             </ul>
  24.         {% endif %}
  25.     {% endmacro %}
  26.     {# @see https://github.com/bolt/bolt/pull/2388 #}
  27.     {% from _self import tree %}
  28.     <div class="ec-categoryNaviRole">
  29.        <div class="ec-categoryNaviRole__title">カテゴリ</div>
  30.         <div class="ec-categoryNaviRole__item">
  31.             <ul class="ec-categoryNaviRole__lists">
  32.                 {% for Category in Categories %}
  33.                     <li>
  34.                         {{ tree(Category) }}
  35.                     </li>
  36.                 {% endfor %}
  37.             </ul>
  38.         </div>
  39.     </div>
  40.     <!-- ログイン -->
  41.     {{ include('Block/login.twig') }}
  42.     <!-- カート -->
  43.     <div class="ec-headerRole__cart">
  44.     {{ include('Block/cart.twig') }}
  45.     </div>
  46. </div>
  47. <!-- SP用ナビアイコン -->
  48. <div class="ec-headerRole__navSP">
  49.     {{ include('Block/nav_sp.twig') }}
  50. </div>
  51. {% endif %}
  52. </header>
  53. <style>
  54. /***********************************************************************
  55.  slime_header ver.1.0
  56. ***********************************************************************/
  57. /* ▼▼▼ 文字・アイコン・背景色や横幅の変更ここから ▼▼▼
  58. ***********************************************************************/
  59. .ec-headerRole{
  60.     max-width: none;/* ヘッダー横幅制限したい場合は1130pxに変更 */
  61.     background: rgba(255,255,255,1);/* 背景色を変更 */
  62.     height: 60px;/* ヘッダーの高さ */
  63. }
  64. .ec-headerRole .ec-headerTitle a,
  65. .ec-headerNav .ec-headerNav__itemLink,
  66. .ec-headerNav .ec-headerNav__item .ec-headerNav__itemIcon,
  67. .ec-cartNavi,
  68. .ec-categoryNaviRole__title,
  69. .ec-headerRole .ec-categoryNaviRole{
  70.     color: #000;/* ヘッダー基本的な文字・アイコン色を変更 */
  71. }
  72. @media (min-width:768px){
  73.     .ec-headerRole:hover{
  74.         background: rgba(255,255,255,1);/* 背景色を変更 */
  75.     }
  76.     .ec-headerNav .ec-headerNav__item .ec-headerNav__itemIcon,
  77.     .ec-cartNavi{
  78.         color: #757575;/* PC時アイコンの色を変更 */
  79.     }
  80.     .ec-headerRole .ec-categoryNaviRole li a{
  81.         width: 180px;/* カテゴリの横幅変更はこちら */
  82.         color: #282828;/* カテゴリの文字色を変更 */
  83.         background: rgba(255,255,255,0.8);/* カテゴリの背景色変更はこちら rgba(255,255,255,0.8) ← #fffなどの形式でも指定可能 */
  84.     }
  85.     .ec-headerRole .ec-categoryNaviRole ul ul{
  86.         left: 180px; /* カテゴリ横幅変更時に合わせて同じ数値に変更 */
  87.     }
  88.     .ec-headerRole .ec-categoryNaviRole li a:hover{
  89.         background: rgba(250,250,250,0.8);/* カテゴリhover時の背景色変更はこちら rgba(255,255,255,0.8) ← #fffなどの形式でも指定可能 */
  90.     }
  91.     .ec-headerRole .ec-categoryNaviRole li ul:before {
  92.         color: #282828;/* カテゴリの>(アローアイコン)の色変更はこちら */
  93.     }
  94. }
  95. /* メインコンテンツ外枠の横幅固定を外す */
  96. .ec-layoutRole .ec-layoutRole__contents{
  97.     max-width: none; /* 1150px; */
  98. }
  99. /* スライドショーの横幅固定を外す */
  100. .ec-sliderRole{
  101.    max-width: none; /* 1130px; */
  102.    padding-left: 0; /* 20px; */
  103.    padding-right: 0; /* 20px; */
  104. }
  105. /* ▲▲▲ 文字・アイコン・背景色や横幅の変更ここまで ▲▲▲
  106. ***********************************************************************/
  107. .ec-headerRole{
  108.     display: flex;
  109.     justify-content: space-between;
  110.     align-items: center;
  111.     position: relative;
  112.     padding: 15px 30px;
  113.     z-index: 999;
  114. }
  115. .ec-headerRole .ec-headerTitle{
  116.     font-size: 18px;
  117.     font-weight: bold;
  118.     margin: 0 0 0 30px;
  119. }
  120. .ec-headerRole .ec-headerNav{
  121.     margin-right: 0;
  122. }
  123. .ec-headerRole .ec-headerNaviRole{
  124.     width: auto;
  125.     max-width: none;
  126.     padding: 0;
  127.     margin: 0 0 0 auto;
  128. }
  129. .ec-headerNav .ec-headerNav__item{
  130.     font-size: 14px;
  131. }
  132. .ec-headerNav .ec-headerNav__itemIcon {//SPアイコン表示
  133.     display: inline-block;
  134.     margin-right: 5px;
  135.     margin-left: 5px;
  136.     font-size: 18px;
  137. }
  138. .ec-headerNav .ec-headerNav__item .ec-headerNav__itemIcon{
  139.     display: inline-block;
  140. }
  141. .ec-cartNavi {
  142.     padding: 3px 0 0 10px;
  143. }
  144. .ec-headerNavSP{
  145.     top: 8px;
  146. }
  147. .ec-headerNav{
  148.     display: none;
  149. }
  150. .ec-headerRole .ec-categoryNaviRole{
  151.     display: none;
  152. }
  153. @media (min-width:768px){
  154.    .front_page .ec-headerRole{
  155.         position: fixed;
  156.         top: 0;
  157.         left: 0;
  158.         width: 100%;
  159.         transition: 0.4s;
  160.     }
  161.     .ec-headerRole a:hover{
  162.         text-decoration: none;
  163.         opacity: 0.8;
  164.     }
  165.     .ec-headerRole .ec-headerTitle{
  166.         margin: 0;
  167.     }
  168.     .ec-headerRole .ec-headerNav{
  169.         margin-right: 20px;
  170.     }
  171.     .ec-headerNav .ec-headerNav__item{
  172.         margin: 0 10px;
  173.     }
  174.     .ec-headerNav .ec-headerNav__item .ec-headerNav__itemIcon {
  175.         display: none;/*アイコン表示したい場合はinleine-blockに変更*/
  176.     }
  177.     .ec-headerNav .ec-headerNav__item a{
  178.         font-size: 14px;
  179.         font-weight: bold;
  180.     }
  181.     .ec-headerRole .ec-cartNavi {
  182.         padding: 12px 17px 10px;
  183.     }
  184.     .ec-headerNav{
  185.         display: block;
  186.     }
  187.     .ec-headerRole .ec-categoryNaviRole{
  188.         position: relative;
  189.         padding: 0;
  190.         font-size: 14px;
  191.         font-weight: bold;
  192.         color: #585858;
  193.         margin-right: 18px;
  194.         transform: translateY(1px);
  195.         max-width: none;
  196.         width: auto;
  197.         display: block;
  198.     }
  199.     .ec-headerRole .ec-categoryNaviRole__title{
  200.         cursor: pointer;
  201.     }
  202.     .ec-headerRole .ec-categoryNaviRole__item{
  203.         position: absolute;
  204.         top: 0;
  205.         left: 0;
  206.         display: none;
  207.         padding-top: 45px;
  208.     }
  209.     .ec-headerRole .ec-categoryNaviRole:hover .ec-categoryNaviRole__item{
  210.         display: block;
  211.     }
  212.     .ec-headerRole .ec-categoryNaviRole ul{
  213.         margin: 0;
  214.         padding: 0;
  215.     }
  216.     .ec-headerRole .ec-categoryNaviRole ul ul{
  217.         position: absolute;
  218.         top: 0;
  219.     }
  220.     .ec-headerRole .ec-categoryNaviRole ul ul li{
  221.         display: none;
  222.     }
  223.     .ec-headerRole .ec-categoryNaviRole li:hover>ul>li{
  224.         display: block;
  225.     }
  226.     .ec-headerRole .ec-categoryNaviRole li{
  227.         list-style: none;
  228.         position: relative;
  229.         box-sizing: border-box;
  230.     }
  231.     .ec-headerRole .ec-categoryNaviRole li a{
  232.         display: block;
  233.         padding: 15px;
  234.     }
  235.     .ec-headerRole .ec-categoryNaviRole li ul:before {
  236.         content: "\f054";
  237.         font-family: "Font Awesome 5 Free";
  238.         font-weight: 900;
  239.         font-size: 10px;
  240.         position: absolute;
  241.         top: 18px;
  242.         right: auto;
  243.         left: -20px;
  244.     }
  245. }
  246. {# .ec-layoutRole .ec-layoutRole__main{
  247.     height: calc(100vh - 60px);
  248. } #}
  249. /***********************************************************************
  250.  slime_header ここまで
  251. ***********************************************************************/
  252. </style>