app/template/lag/index.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. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'front_page' %}
  10. {% set NewsList = repository('Eccube\\Entity\\News').getList() %}
  11. {% block stylesheet %}
  12.     <style>
  13.         .slick-slider{
  14.           height:100%;
  15.           width: 100%;
  16.           overflow: hidden;
  17.         }
  18.         .main_visual.slick-slider .slick-list,
  19.         .main_visual.slick-slider .slick-track,
  20.         .main_visual.slick-slider .slick-slide,
  21.         .main_visual.slick-slider .slick-track > .slick-slide > div,
  22.         .main_visual.slick-slider .slick-slide img{
  23.           height:100%;
  24.         }
  25.         .main_visual.slick-slider .slick-slide{
  26.           overflow:hidden;
  27.         }
  28.         .main_visual.slick-slider .slick-slide img{
  29.           opacity:0.8;
  30.         }
  31.         .main_visual.slick-slider:before {
  32.           background: rgba(60, 20, 0, .2);
  33.           content: '';
  34.           display: block;
  35.           height: 100%;
  36.           left: 0;
  37.           opacity: .6;
  38.           position: absolute;
  39.           top: 0;
  40.           width: 100%;
  41.           z-index: 10;
  42.         }
  43.         .main_visual.slick-slider:after {
  44.           background: linear-gradient(217deg, rgba(110, 72, 51, .6), rgba(255, 0, 0, 0) 70.71%), linear-gradient(127deg, rgba(241, 234, 230, .6), rgba(0, 255, 0, 0) 70.71%), linear-gradient(336deg, rgba(249, 247, 245, .6), rgba(0, 0, 255, 0) 70.71%);
  45.           content: '';
  46.           display: block;
  47.           height: 100%;
  48.           left: 0;
  49.           opacity: .6;
  50.           position: absolute;
  51.           top: 0;
  52.           width: 100%;
  53.           z-index: 5;
  54.         }
  55.         .slick-slide{
  56.           position:relative;
  57.         }
  58.       /* テキストのフェードインとスライドイン */
  59.       .main {
  60.           opacity: 0;
  61.           transform: translateX(10vw); /* 右からスライドイン */
  62.           transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  63.       }
  64.       .sub {
  65.           opacity: 0;
  66.           transform: translateX(10vw); /* 右からスライドイン */
  67.           transition: opacity 0.5s ease-in-out 0.3s, transform 0.5s ease-in-out 0.2s; /* 0.2秒遅れ */
  68.       }
  69.       .fade-in .main {
  70.           opacity: 1;
  71.           transform: translateX(0); /* 元の位置に戻る */
  72.       }
  73.       .fade-in .sub {
  74.           opacity: 1;
  75.           transform: translateX(0); /* 元の位置に戻る */
  76.       }
  77. /* 背景画像の設定 */
  78. .slick-slide {
  79.   overflow:hidden;
  80. }
  81. @-webkit-keyframes fadezoom {
  82.     0% {
  83.         transform: scale(1);
  84.     }
  85.     100% {
  86.         transform: scale(1.25);
  87.     }
  88. }
  89. @keyframes fadezoom {
  90.     0% {
  91.         transform: scale(1);
  92.     }
  93.     100% {
  94.         transform: scale(1.25);
  95.     }
  96. }
  97. .slick-animation {
  98.     animation: fadezoom 20s linear 0s normal both;
  99. }
  100.     </style>
  101. {% endblock %}
  102. {% block javascript %}
  103.     <script>
  104.       $(function() {
  105.         // メインスライダーの初期化時のイベント
  106.         $('.main_visual').on('init', function () {
  107.           // 最初のスライドにアニメーションを適用
  108.           $('.slick-slide[data-slick-index="0"] img').addClass('slick-animation');
  109.         });
  110.         // メインスライダーの設定
  111.         $('.main_visual').slick({
  112.           autoplay: true,          // 自動再生
  113.           infinite: true,          // 無限ループ
  114.           slidesToShow: 1,         // 1つのスライドを表示
  115.           slidesToScroll: 1,       // スライドを1つずつスクロール
  116.           arrows: false,           // 矢印を非表示
  117.           speed: 3000,             // フェードアニメーションの速度
  118.           autoplaySpeed: 5000,     // スライドが切り替わる間隔
  119.           pauseOnFocus: false,     // フォーカス時にスライドを一時停止しない
  120.           pauseOnHover: false,     // ホバー時にスライドを一時停止しない
  121.           asNavFor: '.text_slider' // .text_slider と同期
  122.         })
  123.         .on({
  124.           beforeChange: function(event, slick, currentSlide, nextSlide) {
  125.             // 次のスライドに 'slick-animation' クラスを追加
  126.             $(".main_visual .slick-slide[data-slick-index='" + nextSlide + "'] img").addClass("slick-animation");
  127.           },
  128.           afterChange: function(event, slick, currentSlide) {
  129.             // 前のスライドのインデックスを計算
  130.             var prevSlide = (currentSlide === 0) ? slick.slideCount - 1 : currentSlide - 1;
  131.             // 一つ前のスライドから 'slick-animation' クラスを削除
  132.             $(".main_visual .slick-slide[data-slick-index='" + prevSlide + "'] img").removeClass("slick-animation");
  133.           }
  134.         });
  135.         // テキストスライダーの初期化時のイベント
  136.         $('.text_slider').on('init', function () {
  137.           // 最初のスライドに 'fade-in' クラスを適用
  138.           $('.slick-slide[data-slick-index="0"]').addClass('fade-in');
  139.         });
  140.         // テキストスライダーの設定(メインスライダーと同期)
  141.         $('.text_slider').slick({
  142.           autoplay: true,          // 自動再生
  143.           infinite: true,          // 無限ループ
  144.           slidesToShow: 1,         // 1つのスライドを表示
  145.           slidesToScroll: 1,       // スライドを1つずつスクロール
  146.           fade: true,
  147.           speed: 1000,
  148.           autoplaySpeed: 5000,
  149.           arrows: false,
  150.           pauseOnFocus: false,
  151.           pauseOnHover: false,
  152.           pauseOnDotsHover: false,
  153.           asNavFor: '.main_visual' // .main_visual と同期
  154.         })
  155.         .on({
  156.           beforeChange: function(event, slick, currentSlide, nextSlide) {
  157.             // 次のスライドに 'fade-in' クラスを追加
  158.             $(".text_slider .slick-slide[data-slick-index='" + nextSlide + "']").addClass("fade-in");
  159.           },
  160.           afterChange: function(event, slick, currentSlide) {
  161.             // 現在のスライド以外のすべてのスライドから 'fade-in' クラスを削除
  162.             $(".text_slider .slick-slide").not("[data-slick-index='" + currentSlide + "']").not(".slick-cloned").removeClass("fade-in");
  163.             // 現在のスライドにクラスを確実に追加
  164.            $(".text_slider .slick-slide[data-slick-index='" + currentSlide + "']").addClass("fade-in");
  165.           }
  166.         });
  167.       });
  168.       $(function() {
  169.           $('.topic_slider').slick({
  170.               vertical: true,
  171.               autoplay: true,
  172.               autoplaySpeed: 3800,
  173.               speed: 800,
  174.               arrows: true,
  175.               pauseOnFocus: false,
  176.               pauseOnHover: false,
  177.               pauseOnDotsHover: false
  178.           });
  179.             $('.ec-sliderRole__news').each(function() {
  180.                 var listLength = $(this).find('.ec-sliderRole__newsItem').length;
  181.                 if (listLength > 5) {
  182.                     $(this).find('.ec-sliderRole__newsItem:gt(4)').each(function() {
  183.                         $(this).hide();
  184.                     });
  185.                     $(this).append('<a id="news_readmore" class="ec-inlineBtn--top">{{ 'more'|trans }}</a>');
  186.                     var dispNum = 5;
  187.                     $(this).find('#news_readmore').click(function() {
  188.                         dispNum += 5;
  189.                         $(this).parent().find('.ec-sliderRole__newsItem:lt(' + dispNum + ')').show();
  190.                         if (dispNum >= listLength) {
  191.                             $(this).hide();
  192.                         }
  193.                     })
  194.                 }
  195.             });
  196.       });
  197.     </script>
  198. {% endblock javascript %}
  199. {% block main %}
  200.     <div class="ec-sliderRole">
  201.       <div class="ec-sliderRole__wrap">
  202.         <div class="mv__wrap">
  203.           <div class="main_visual">
  204.               <div class="item slick-slide">
  205.                 <img src="{{ asset('assets/img/top/01.jpg') }}" class="outset">
  206.               </div>
  207.               <div class="item slick-slide">
  208.                 <img src="{{ asset('assets/img/top/02.jpg') }}" class="outset">
  209.               </div>
  210.               <div class="item slick-slide">
  211.                 <img src="{{ asset('assets/img/top/03.jpg') }}" class="outset">
  212.               </div>
  213.               <div class="item slick-slide">
  214.                 <img src="{{ asset('assets/img/top/04.jpg') }}" class="outset">
  215.               </div>
  216.           </div>
  217.           <div class="text_slider">
  218.             <div class="ec-sliderRole__title">
  219.               <div class="main">Lillie and</div>
  220.               <div class="sub">Garcello</div>
  221.             </div>
  222.             <div class="ec-sliderRole__title">
  223.               <div class="main">ORIGINAL</div>
  224.               <div class="sub">GOODS</div>
  225.             </div>
  226.             <div class="ec-sliderRole__title">
  227.               <div class="main">RECOMMENDED</div>
  228.               <div class="sub">ITEM</div>
  229.             </div>
  230.             <div class="ec-sliderRole__title">
  231.               <div class="main">LIMITED</div>
  232.               <div class="sub">SET</div>
  233.             </div>
  234.           </div>
  235.         </div>
  236.         <div class="ec-sliderRole__news topic_slider">
  237.             {% for News in NewsList %}
  238.                 <a href={{ url('news_detail',  {'id': News.id}) }} class="ec-sliderRole__newsItem" target="_blank">
  239.                     <div class="ec-sliderRole__newsHeading">
  240.                         <div class="ec-sliderRole__newsDate">
  241.                             {{ News.publish_date|date_day }}
  242.                         </div>
  243.                         <div class="ec-sliderRole__newsColumn">
  244.                             <div class="ec-sliderRole__newsTitle">
  245.                                 {{ News.title }}
  246.                             </div>
  247.                             {# {% if News.description or News.url %}
  248.                                 <div class="ec-sliderRole__newsClose">
  249.                                     <a class="ec-sliderRole__newsCloseBtn">
  250.                                         <i class="fas fa-angle-down"></i>
  251.                                     </a>
  252.                                 </div>
  253.                             {% endif %} #}
  254.                         </div>
  255.                     </div>
  256.                     {# <div class="ec-sliderRole__newsDescription">
  257.                         {{ News.description|raw|nl2br }}
  258.                         {% if News.url %}
  259.                             <br>
  260.                             <a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank"{% endif %}>{{ '詳しくはこちら'|trans }}</a>
  261.                         {% endif %}
  262.                     </div> #}
  263.                 </a>
  264.             {% endfor %}
  265.         </div>
  266.       </div>
  267.     </div>
  268. {% endblock %}