{{ 'section-slideshow-v3.css' | asset_url | stylesheet_tag }}

<xo-animate xo-cascade>
  <div {% render 'section-attr' %}>
    {% render 'section-bg-image' %}
    <div  class='slideshow-v3'>
    <xo-container {% render 'section-layout' %}>
      <xo-carousel
        xo-render-bullet='<span class="slideshow-v3__bullet"></span>'
        xo-type='none'
        {% if section.settings.autoplay %}
          xo-autoplay='{{ section.settings.speed | times: 1000 }}'
        {% endif %}
        xo-speed='400'
        xo-loop
        xo-hover-pause
       
      >
        <xo-carousel-inner>
          <xo-carousel-list>
            {% for block in section.blocks %}
              {%- case block.type -%}
                {%- when 'slideshow' -%}
                  <xo-carousel-slide class='slideshow-v3__slide'>
                    <xo-grid class='slideshow-v3__item'>
                      <div style='--xs:12; --lg: 6 ' class='slideshow-v3__left'>
                        <div class='slideshow-v3__content'>
                          <h1 class='slideshow-v3__title'>{{ block.settings.title }}</h1>
                          <div class='slideshow-v3__subtitle'>
                            <p>{{ block.settings.subtitle }}</p>
                          </div>
                          <div class='slideshow-v3__description'>
                            <p>{{ block.settings.description }}</p>
                          </div>
                        </div>
                        <div class='slideshow-v3__button'>
                          {% render 'button',
                            text: block.settings.button_text,
                            link: block.settings.button_link,
                            mode: block.settings.button_mode,
                            style: block.settings.button_style,
                            size: block.settings.button_size,
                            radius: block.settings.button_radius,
                            padding: block.settings.button_padding
                          %}
                        </div>
                      </div>
                      <div style='--xs:12; --lg: 6 ' class='slideshow-v3__image'>
                        {% render 'image', image: block.settings.image %}
                      </div>
                    </xo-grid>
                  </xo-carousel-slide>
              {%- endcase -%}
            {% endfor %}
          </xo-carousel-list>
        </xo-carousel-inner>
        <xo-carousel-pagination class='slideshow-v3__pagination'></xo-carousel-pagination>
        <xo-carousel-prev
          ><button class='slideshow-v3__prev'>{% render 'icon', name: 'arrow-left2', icon_size: '10', color: 'rgb(var(--color-foreground))' %}</button></xo-carousel-prev
        >
        <xo-carousel-next
          ><button class='slideshow-v3__next'>{% render 'icon', name: 'arrow-right2', icon_size: '10', color: 'rgb(var(--color-foreground))' %}</button></xo-carousel-next
        >
      </xo-carousel>
    </xo-container>
    </div>
  </div>
</xo-animate>

{% schema %}
{
  "name": "t:sections.slideshow_v3.name",
  "tag": "section",
  "class": "section",
  "settings": [
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.all.width.label",
      "default": "box",
      "options": [
        {
          "value": "box",
          "label": "t:sections.all.width.options__1.label"
        },
        {
          "value": "wide",
          "label": "t:sections.all.width.options__2.label"
        },
        {
          "value": "fullwidth",
          "label": "t:sections.all.width.options__3.label"
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "autoplay",
      "label": "t:sections.slideshow_v3.settings.autoplay.label",
      "default": false
    },
    {
      "type": "range",
      "id": "speed",
      "min": 5,
      "max": 20,
      "step": 5,
      "label": "t:sections.slideshow_v3.settings.speed.label",
      "default": 5,
      "unit": "px"
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.bg_color.label"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.bg_gradient.label"
    },
    {
      "type": "image_picker",
      "id": "background_image_desktop",
      "label": "t:sections.all.background_image_desktop.label"
    },
    {
      "type": "image_picker",
      "id": "background_image_mobile",
      "label": "t:sections.all.background_image_mobile.label"
    },
    {
      "type": "checkbox",
      "id": "use_parallax",
      "label": "t:sections.all.use_parallax.label",
      "default": true
    },
    {
      "type": "number",
      "id": "padding_top",
      "label": "t:sections.all.padding_top.label",
      "default": 50
    },
    {
      "type": "number",
      "id": "padding_bottom",
      "label": "t:sections.all.padding_bottom.label",
      "default": 50
    }
  ],
  "blocks": [
    {
      "type": "slideshow",
      "name": "t:sections.slideshow_v3.blocks.slideshow.name",
      "settings": [
        {
          "type": "header",
          "content": "t:sections.slideshow_v3.blocks.slideshow.settings.heading_left.content"
        },
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.slideshow_v3.blocks.slideshow.settings.title.label",
          "default": "SECTION TITLE"
        },
        {
          "type": "text",
          "id": "subtitle",
          "label": "t:sections.slideshow_v3.blocks.slideshow.settings.subtitle.label",
          "default": "SECTION SUBTITLE"
        },
        {
          "type": "text",
          "id": "description",
          "label": "t:sections.slideshow_v3.blocks.slideshow.settings.description.label",
          "default": "SECTION SMALL TITLE",
          "info": "t:sections.slideshow_v3.blocks.slideshow.settings.description.content"
        },
        {
          "type": "header",
          "content": "t:sections.all.button_heading.content"
        },
        {
          "type": "text",
          "id": "button_text",
          "label": "t:sections.all.button_text.label",
          "default": "ALL PRODUCTS"
        },
        {
          "type": "url",
          "id": "button_link",
          "label": "t:sections.all.button_link.label",
          "default": "/collections/all"
        },
        {
          "type": "select",
          "id": "button_mode",
          "label": "t:sections.all.button_mode.label",
          "options": [
            {
              "value": "light",
              "label": "t:sections.all.button_mode.option__1.label"
            },
            {
              "value": "dark",
              "label": "t:sections.all.button_mode.option__2.label"
            }
          ],
          "default": "light"
        },
        {
          "type": "select",
          "id": "button_style",
          "label": "t:sections.all.button_style.label",
          "options": [
            {
              "value": "primary",
              "label": "t:sections.all.button_style.option__1.label"
            },
            {
              "value": "secondary",
              "label": "t:sections.all.button_style.option__2.label"
            },
            {
              "value": "tertiary",
              "label": "t:sections.all.button_style.option__3.label"
            },
            {
              "value": "link",
              "label": "t:sections.all.button_style.option__4.label"
            }
          ],
          "default": "secondary"
        },
        {
          "type": "select",
          "id": "button_size",
          "label": "t:sections.all.button_size.label",
          "options": [
            {
              "value": "xs",
              "label": "t:sections.all.button_size.option__0.label"
            },
            {
              "value": "sm",
              "label": "t:sections.all.button_size.option__1.label"
            },
            {
              "value": "md",
              "label": "t:sections.all.button_size.option__2.label"
            },
            {
              "value": "lg",
              "label": "t:sections.all.button_size.option__3.label"
            }
          ],
          "default": "sm"
        },
        {
          "type": "range",
          "id": "button_radius",
          "label": "t:sections.all.button_radius.label",
          "max": 4,
          "min": 0,
          "step": 0.2,
          "unit": "rem",
          "default": 0.8
        },
        {
          "type": "range",
          "id": "button_padding",
          "label": "t:sections.all.button_padding.label",
          "info": "t:sections.all.button_padding.info",
          "max": 10,
          "min": 0,
          "step": 0.2,
          "unit": "rem",
          "default": 1.4
        },
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.slideshow_v3.blocks.slideshow.settings.image.label",
          "info": "600 x 700px recommended"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.slideshow_v3.presets.name"
    }
  ]
}
{% endschema %}
