{% sw_extends'@Storefront/storefront/element/cms-element-thumbnail-slider.html.twig' %}
{% set isSlider = element.config.active.value %}
{% block nd_cms_element_slider_container_slider_settings %}
{% if isSlider %}
{% set slick_settings_modal = {
"mobileFirst": true,
"arrows": true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
"responsive": [
{
"breakpoint": 1,
"settings": "unslick"
},
{
"breakpoint": 1023,
"settings": {
"dots": false,
"arrows": true,
"infinite": false,
"slidesToShow": 4,
}
}
]
} %}
{% endif %}
<section class="hero-carousel mb-5 md:mb-10">
<div class="page-max-width">
<div class="wrapper relative">
<div class="w-full text-center mb-4 md:mb-10">
<h1>{{ element.config.title.value }}</h1>
</div>
<div class="{% if isSlider %} slick-thumbnail slick-init slick-after-lg slick-swipe-mobile slick-padding-boxed-layout {% else %} flex flex-col md:flex-row space-y-6 md:space-y-0 space-x-0 md:space-x-6 justify-center {% endif %}"
data-slick='{{ slick_settings_modal|json_encode }}'>
{% for key, slide in element.data.get('slides') %}
<div class="w-auto h-auto">
<div class="{% if isSlider %}relative w-56 h-56 mx-auto md:mx-auto lg:mx-auto xl:mx-4 xl:w-auto xl:h-auto {% else %} w-full h-72 mx-auto xl:w-72 xl:h-72 2xl:w-full 2xl:h-auto {% endif %}">
{% if slide.url %}
<a href="{{ slide.url }}">
{% endif %}
{# CHECK if desktop image exists, use two square blocks if it exists. If not, use a single 16x9 image #}
{% if slide.mobile_image %}
{% sw_thumbnails 'cms-image-thumbnails' with {
media: slide.mobile_image,
load: true,
attributes: {
'class': 'w-full h-full object-cover',
'alt': (slide.mobile_image.translated.alt ?: ''),
'title': (slide.mobile_image.translated.title ?: '')
}
} %}
{% endif %}
<div class="container relative text-black z-10 text-center">
{% if slide.text %}
<div class="hidden cursor-pointer w-full max-w-[80%] py-2 px-6 uppercase md:block btn-outline absolute bottom-6 left-1/2 transform -translate-x-1/2 flex items-center font-bold break-all">
{{ slide.text }}
</div>
{% endif %}
{% if slide.mobileText %}
<div class="md:hidden cursor-pointer block w-full max-w-[80%] py-2 px-6 uppercase btn-outline absolute bottom-2 left-1/2 transform -translate-x-1/2 flex justify-center items-center font-bold break-all">
{{ slide.mobileText }}
</div>
{% endif %}
</div>
{% if slide.url %}
</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</section>
{% endblock %}
{% block nd_cms_element_slider_container_buttons %}
{% if isSlider %}
<div class="h-full hidden md:block">
{% block nd_cms_element_slider_container_buttons_prev %}
<button id="prev-slide-{{ element.id }}"
class="products-back shadow-lg bg-white p-2 2xl:p-3 absolute -left-1 lg:-left-2 top-1/2 transform -translate-y-1/2 flex flex-col items-center text-white">
{% sw_icon 'icon-leading-left' style{ 'pack': 'theme-icons', 'class': 'stroke w-6 2xl:w-7 text-gray-900' } %}
</button>
{% endblock %}
{% block nd_cms_element_slider_container_buttons_next %}
<button id="next-slide-{{ element.id }}"
class="products-back shadow-lg bg-white p-2 2xl:p-3 absolute -right-1 lg:-right-2 top-1/2 transform -translate-y-1/2 flex flex-col items-center text-white">
{% sw_icon 'icon-leading-right' style{ 'pack': 'theme-icons', 'class': 'stroke w-6 2xl:w-7 text-gray-900' } %}
</button>
{% endblock %}
</div>
{% endif %}
{% endblock %}