{# Slider element is developed by no.dots #}
{% block nd_cms_element_slider_container %}
{% block nd_cms_element_slider_container_slider_settings %}
{% if element.config.active.value %}
{% set slick_settings_modal = {
"slidesToShow": 1,
"infinite": false,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
"responsive": [
{
"breakpoint": 400,
"settings": "unslick"
},
{
"breakpoint": 769,
"settings": {
"slidesToShow": 4,
}
},
{
"breakpoint": 1000,
"settings": {
"slidesToShow": 4,
}
},
{
"breakpoint": 500,
"settings": "unslick"
}
]
} %}
{% else %}
{% set slick_settings_modal = {
"slidesToShow": 1,
"mobileFirst": true,
"infinite": false,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
"responsive": [
{
"breakpoint": 400,
"settings": {
"slidesToShow": 3,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
}
},
{
"breakpoint": 769,
"settings": {
"slidesToShow": 5,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
}
},
{
"breakpoint": 1000,
"settings": {
"slidesToShow": 5,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
}
},
{
"breakpoint": 500,
"settings": {
"slidesToShow": 4,
"arrows":true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
}
}
]
} %}
{% endif %}
<section class="hero-carousel">
<div class="page-max-width">
<div class="wrapper relative">
<div class="w-full text-center mb-4 md:mb-10 h1">
<h1>{{ element.config.title.value }}</h1>
</div>
<div class="slick-thumbnail slick-init flex flex-row space-x-8 justify-center items-center"
data-slick='{{ slick_settings_modal|json_encode }}'>
{% for key, slide in element.data.get('slides') %}
<div class="flex flex-col justify-center items-center">
<div>
{# CHECK if desktop image exists, use two square blocks if it exists. If not, use a single 16x9 image #}
<div class="inset-0">
{% if slide.mobile_image %}
<div class="w-28 h-28 lg:h-40 lg:w-40 mx-auto">
{% sw_thumbnails 'cms-image-thumbnails' with {
media: slide.mobile_image,
load: true,
attributes: {
'class': 'rounded-full w-full h-full object-cover object-center',
'alt': (slide.mobile_image.translated.alt ?: ''),
'title': (slide.mobile_image.translated.title ?: '')
}
} %}
</div>
{% endif %}
</div>
<div class="container text-black z-10 text-center">
{% if slide.text %}
<div class="hidden md:block font-bold my-4 break-all">
{{ slide.text }}
</div>
{% endif %}
{% if slide.mobileText %}
<div class="md:hidden font-bold my-4 break-all">
{{ slide.mobileText }}
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock %}
{% block nd_cms_element_slider_container_buttons %}
<div class="flex grid-gap-2 justify-end mr-2 lg:mr-6 xl:mr-6 2xl:mr-10">
{% block nd_cms_element_slider_container_buttons_prev %}
<button id="prev-slide-{{ element.id }}"
class="products-back flex p-1 text-white transition duration-300 active:-translate-x-0.5 hover:-translate-x-0.5">
{% sw_icon 'arrow-left' style{ 'pack': 'default', 'class': 'full-size w-8' } %}
</button>
{% endblock %}
{% block nd_cms_element_slider_container_buttons_next %}
<button id="next-slide-{{ element.id }}"
class="products-next flex p-1 text-white transition duration-300 active:translate-x-0.5 hover:translate-x-0.5">
{% sw_icon 'arrow-right' style{ 'pack': 'default', 'class': ' full-size w-8' } %}
</button>
{% endblock %}
</div>
{% endblock %}
</div>
</div>
</section>
{% endblock %}