voici un carousel en liquid de shopify, adapte le en utilisant swiper js {{…
- User
voici un carousel en liquid de shopify, adapte le en utilisant swiper js {{ 'section-image-banner.css' | asset_url | stylesheet_tag }} {{ 'component-slider.css' | asset_url | stylesheet_tag }} {{ 'component-slideshow.css' | asset_url | stylesheet_tag }}
{%- if section.settings.slide_height == 'adapt_image' and section.blocks.first.settings.image != blank -%} {%- style -%} @media screen and (max-width: 749px) { #Slider-{{ section.id }}::before, #Slider-{{ section.id }} .media::before, #Slider-{{ section.id }}:not(.banner--mobile-bottom) .banner__content::before { padding-bottom: {{ 1 | divided_by: section.blocks.first.settings.image.aspect_ratio | times: 100 }}%; content: ''; display: block; } }
@media screen and (min-width: 750px) { #Slider-{{ section.id }}::before, #Slider-{{ section.id }} .media::before { padding-bottom: {{ 1 | divided_by: section.blocks.first.settings.image.aspect_ratio | times: 100 }}%; content: ''; display: block; } }{%- endstyle -%} {%- endif -%}
<slideshow-component class="slider-mobile-gutter{% if section.settings.layout == 'grid' %} page-width{% endif %}{% if section.settings.show_text_below %} mobile-text-below{% endif %}" role="region" aria-roledescription="{{ 'sections.slideshow.carousel' | t }}" aria-label="{{ section.settings.accessibility_info | escape }}"
{%- if section.settings.auto_rotate and section.blocks.size > 1 -%} {% render 'icon-caret' %} {%- if section.settings.slider_visual == 'counter' -%} 1 / {{ 'general.slider.of' | t }} {{ section.blocks.size }} {%- else -%} {%- for block in section.blocks -%} {%- if section.settings.slider_visual == 'numbers' -%} {{ forloop.index -}} {%- else -%} {%- endif -%} {%- endfor -%} {%- endif -%} {% render 'icon-caret' %}
{%- if section.settings.auto_rotate -%} <button type="button" class="slideshow__autoplay slider-button no-js-hidden{% if section.settings.auto_rotate == false %} slideshow__autoplay--paused{% endif %}" aria-label="{{ 'sections.slideshow.pause_slideshow' | t }}" > {%- render 'icon-pause' -%} {%- render 'icon-play' -%} </button> {%- endif -%} </div> <noscript> <div class="slider-buttons"> <div class="slider-counter"> {%- for block in section.blocks -%} <a href="#Slide-{{ section.id }}-{{ forloop.index }}" class="slider-counter__link link" aria-label="{{ 'sections.slideshow.load_slide' | t }} {{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}" > {{ forloop.index }} </a> {%- endfor -%} </div> </div> </noscript>{%- endif -%}
{%- if section.blocks.size > 1 and section.settings.auto_rotate == false -%} {% render 'icon-caret' %} {%- if section.settings.slider_visual == 'counter' -%} 1 / {{ 'general.slider.of' | t }} {{ section.blocks.size }} {%- else -%} {%- for block in section.blocks -%} {%- if section.settings.slider_visual == 'numbers' -%} {{ forloop.index -}} {%- else -%} {%- endif -%} {%- endfor -%} {%- endif -%} {% render 'icon-caret' %}
- Assistant