src/Eccube/Resource/template/default/product_list.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. {% set body_class = 'front_page' %}
  9. {% block stylesheet %}
  10. <style>
  11.   .slider {
  12.      opacity: 0;
  13.     transition: opacity .3s linear;
  14.   }
  15.    .slider.slick-initialized {
  16.     opacity: 1;
  17.   }
  18. </style>
  19. {% endblock %}
  20. {% block javascript %}
  21.     <script>
  22.         $(document).ready(function(){
  23.             var $id = {{ id }};
  24.             var matchingElement = $('[id="product_carousel__' + $id + '"]');
  25.             matchingElement.not('.slick-initialized').slick({
  26.                 slidesToShow: 4,
  27.                 slidesToScroll: 1,
  28.                 accessibility: true,
  29.                 prevArrow: '<div class="prev-arrow h-full absolute left-[-1.4vw] lg:left-0 top-[50%] translate-y-[-50%] flex items-center justify-center z-20 hover"><img class="w-2 h-5" src="{{ asset('assets/img/top/prev_arrow.svg') }}" /></div>',
  30.                 nextArrow: '<div class="next-arrow h-full absolute right-0 lg:right-[5vw] lessThanLg:pl-0 xxl:pl-[1.5vw] top-[50%] translate-y-[-50%] flex items-center z-20 hover"><img class="w-2 h-5" src="{{ asset('assets/img/top/next_arrow.svg') }}" /></div>',
  31.                 infinite: true,
  32.                 responsive: [
  33.                     {
  34.                         breakpoint: 1024,
  35.                         settings: {
  36.                             slidesToShow: 4,
  37.                             slidesToScroll: 1,
  38.                             infinite: true,
  39.                             appendArrows: $('[id="arrow-box__' + $id + '"]'),
  40.                         }
  41.                     },
  42.                 ]
  43.             });
  44.         });
  45.     </script>
  46. {% endblock javascript %}
  47. {% block main %}
  48.     <div class="{{class}} flex flex-col w-full items-end">
  49.         <div class="flex flex-col w-full">
  50.             <div class="flex justify-between w-full xl:pl-3 md:justify-center md:gap-x-[max(6.4vw,24px)]">
  51.                 <img src="{{ asset(image) }}" alt="商品画像" class="w-[max(44.27vw,850px)] xxl:w-[800px] h-auto max-w-[850px] lg:hidden xxl:pr-3" loading="lazy">
  52.                 <img src="{{ asset(spimage) }}" alt="商品画像" class="w-full max-w-[350px] sm:w-[68vw] h-auto ml-6 md:ml-0 hidden lg:block" loading="lazy">
  53.                 <div class="flex font-extralight gap-7 md:gap-2 xl:pr-[max(3.75vw,22px)]">
  54.                     <p class="text-[22px] [writing-mode:vertical-rl] md:text-xs tracking-[6px] md:tracking-[3px]">{{subtitle}}</p>
  55.                     <p class="text-[36px] [writing-mode:vertical-rl] md:text-lg items-center tracking-[14px] md:tracking-[10px]">{{title}}</p>
  56.                 </div>
  57.             </div>
  58.             {# スライダー #}
  59.             <div class="bg-white relative ml-auto w-[41.66vw] max-w-[808px] mr-7 lg:mr-0 mt-[-5.6vw] lg:mt-[0px] flex box-border lg:w-full">
  60.                 <div id="arrow-box__{{id}}"></div>
  61.                 <div id="product_carousel__{{ id }}" class="relative mx-10 md:mx-4 gap-x-2 md:gap-x-5 w-[40vw] items-center box-border lg:w-[100vw]">
  62.                     {# アイテム #}
  63.                     {% for images in productImages %}
  64.                         {% for image in images %}
  65.                             {% if id == image.category_id %}
  66.                                 <a href={{ url('product_detail', {'id': image.product_id}) }} class="slick-slide w-[8.85vw] drop-shadow-[0_8px_3px_rgba(0,0,0,0.08)] lg:w-[22.9vw] items-center mt-10 md:mt-6 mb-10 product-list box-border hover cursor-pointer" ontouchstart = "">
  67.                                     {% if image.file_name %}
  68.                                         <img src="{{ asset(image.file_name,'save_image') }}" alt="" class="w-[8.85vw] h-[8.85vw] lg:w-[22.9vw] lg:h-[22.9vw]" loading="lazy">
  69.                                     {% else %}
  70.                                         <img src="" alt="" class="w-[8.85vw] h-[8.85vw] lg:w-[22.9vw] lg:h-[22.9vw]" loading="lazy">
  71.                                     {% endif %}
  72.                                     <p class="w-[8.85vw] bg-white lg:w-[22.9vw] h-[74px] md:h-[60px] lg:text-[min(3.2vw,18px)] text-lg py-2 px-3 text-center flex justify-center items-center leading-normal">{{image.name}}</p>
  73.                                 </a>
  74.                             {% endif %}
  75.                         {% endfor %}
  76.                     {% endfor %}
  77.                 </div>
  78.             </div>
  79.         </div>
  80.         <a
  81.             href="{{url('product_list',{'category_id':id})}}"
  82.             class="flex xl:mr-7 ml-auto md:ml-0 md:h-[46px] md:w-[156px] w-[240px] h-[60px] bg-[#EFEEE8] gap-x-5 items-center justify-center border-b-[1px] border-manakaBlack bottom-0 hover cursor-pointer drop-shadow-[0_10px_5px_rgba(0,0,0,0.08)]">
  83.             <p class="md:text-sm tracking-widest">商品一覧</p>
  84.             <img src="{{ asset('assets/img/top/arrow_link.svg') }}" alt="矢印">
  85.         </a>
  86.     </div>
  87. {% endblock %}