{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'front_page' %}
{% block stylesheet %}
<style>
.slick-slider {
margin-bottom: 30px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: " ";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
{% endblock %}
{% block javascript %}
<script>
$(function () {
function fixHeroImagePriority($slider) {
// いったん全部lazy(clone含めて事故防止)
$slider.find('.slick-slide img')
.attr('loading', 'lazy')
.removeAttr('fetchpriority');
// 表示中だけ eager + high
$slider.find('.slick-slide.slick-current img')
.attr('loading', 'eager')
.attr('fetchpriority', 'high');
}
var $mv = $('.main_visual');
$mv
.on('init', function () { fixHeroImagePriority($mv); })
.on('afterChange', function () { fixHeroImagePriority($mv); })
.slick({
dots: true,
arrows: false,
autoplay: true,
speed: 300
// 余裕あれば:, lazyLoad: 'ondemand'
});
// 念のため保険
setTimeout(function(){ fixHeroImagePriority($mv); }, 0);
});
</script>
{% endblock javascript %}
{% block main %}
<div class="ec-sliderRole">
<div class="main_visual">
<div class="item">
<a href="{{ url('homepage') }}goods/locomo-cream-2set"
onClick="ga('send','event','click','top', 'slide_locomox2' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_locomox2_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_locomox2_750x390.jpg') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_locomox2_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_locomox2_1000x360.jpg') }}"
alt="ロコモクリーム331 2個セット"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
<div class="item">
<a href="{{ url('homepage') }}healthfood/tsukudani"
onClick="ga('send','event','click','top', 'slide_tsukudani' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_tsukudani_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_tsukudani_750x390.jpg') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_tsukudani_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_tsukudani_1000x360.jpg') }}"
alt="ミリオン佃煮3点セット"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
<div class="item">
<a href="{{ url('homepage') }}goods/beauty-box"
onClick="ga('send','event','click','top', 'slide_amane' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_amane_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_amane_750x390.jpg') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_amane_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_amane_1000x360.jpg') }}"
alt="amaneジュエリービューティーボックス"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
<div class="item">
<a href="{{ url('homepage') }}health-trend/dashsyoku"
onClick="ga('send','event','click','top', 'slide_dash' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_dash_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_dash_750x390.jpg') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_dash_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_dash_1000x360.jpg') }}"
alt="DASH食"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
<div class="item">
<a href="{{ url('homepage') }}health-trend/beta-carotene"
onClick="ga('send','event','click','top', 'slide_carotene' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_carotene_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_carotene_750x390.jpg') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_carotene_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_carotene_1000x360.jpg') }}"
alt="β-カロテンで今日からできる美肌作り"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
<div class="item">
<a href="{{ url('homepage') }}vegetable-juice/sdgs-episode"
onClick="ga('send','event','click','top', 'slide_sdgs' ,1,{'nonInteraction':1});">
<picture>
<source media="(max-width: 767px)" type="image/webp"
srcset="{{ asset('assets/img/top/bnr_sdgs_750x390.webp') }}">
<source media="(max-width: 767px)"
srcset="{{ asset('assets/img/top/bnr_sdgs_750x390.png') }}">
<source type="image/webp"
srcset="{{ asset('assets/img/top/bnr_sdgs_1000x360.webp') }}">
<img
src="{{ asset('assets/img/top/bnr_sdgs_1000x360.png') }}"
alt="SDGs達成のため、「食品ロス」を減らそう、なくそう。"
width="1000" height="360"
style="width:100%;height:auto;"
loading="lazy">
</picture>
</a>
</div>
</div>
</div>
{% endblock %}