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

<section {% render 'section-attr' %}>
  {% render 'section-bg-image' %}
  <xo-container {% render 'section-layout' %}>
    {%- if section.settings.title != blank -%}
      <h2 class='banner-v264__title'>{{ section.settings.title }}</h2>
    {%- endif -%}
    {%- if section.settings.subtitle != blank -%}
      <h3 class='banner-v264__subtitle'>{{ section.settings.subtitle }}</h3>
    {%- endif -%}
    <xo-carousel
      xo-per-view='{{ section.settings.columns }}'
      xo-gap='{{ section.settings.gap }}'
      class='banner-v264__carousel'
      xo-breakpoints='
        {
          575: {
            perView: 1,
          },
          767: {
            perView: 2,
          }
        }
      '
    >
      <xo-carousel-inner class='banner-v264__inner'>
        <xo-carousel-list>
          {% for block in section.blocks %}
            <xo-carousel-slide
              ><a href='{{ block.settings.link }}' class='banner-v264__item'>
                <div class='{%- render 'hover-style' -%}'>
                  {% render 'image', image: block.settings.image %}
                </div>
                <div class='banner-v264__item-title'>{{ block.settings.title }}</div>
              </a></xo-carousel-slide
            >
          {% endfor %}
        </xo-carousel-list>
      </xo-carousel-inner>
      <xo-carousel-prev class='banner-v264__navigation banner-v264__navigation--prev'>
        <div class='banner-v264__icon-before banner-v264__icon-before--left'>
          {% render 'icon', name: 'chevron-left', icon_size: '20' %}
        </div>
        <div class='banner-v264__icon-after banner-v264__icon-after--left'>
          {% render 'icon', name: 'chevron-left', icon_size: '20' %}
        </div>
      </xo-carousel-prev>
      <xo-carousel-next class='banner-v264__navigation banner-v264__navigation--next'>
        <div class='banner-v264__icon-before banner-v264__icon-before--right'>
          {% render 'icon', name: 'chevron-right', icon_size: '20' %}
        </div>
        <div class='banner-v264__icon-after banner-v264__icon-after--right'>
          {% render 'icon', name: 'chevron-right', icon_size: '20' %}
        </div>
      </xo-carousel-next>
    </xo-carousel>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.banner_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": "select",
      "id": "hover",
      "label": "t:sections.all.hover.label",
      "default": "scale",
      "options": [
        {
          "value": "scale",
          "label": "t:sections.all.hover.option__1.label"
        },
        {
          "value": "rotate",
          "label": "t:sections.all.hover.option__2.label"
        },
        {
          "value": "slide_up",
          "label": "t:sections.all.hover.option__3.label"
        },
        {
          "value": "ripple",
          "label": "t:sections.all.hover.option__4.label"
        },
        {
          "value": "black_white",
          "label": "t:sections.all.hover.option__5.label"
        },
        {
          "value": "shake",
          "label": "t:sections.all.hover.option__6.label"
        }
      ]
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.banner_v3.settings.title.label",
      "default": "Default Title"
    },
    {
      "type": "text",
      "id": "subtitle",
      "label": "t:sections.banner_v3.settings.subtitle.label",
      "default": "Default Subtitle"
    },
    {
      "type": "range",
      "id": "columns",
      "min": 2,
      "max": 5,
      "step": 1,
      "label": "t:sections.banner_v3.settings.columns.label",
      "default": 3
    },
    {
      "type": "number",
      "id": "gap",
      "label": "t:sections.banner_v3.settings.gap.label",
      "default": 20
    },
    {
      "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": "slide",
      "name": "t:sections.banner_v3.blocks.slide.name",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.banner_v3.blocks.slide.image.label"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "t:sections.banner_v3.blocks.slide.title.label"
        },
        {
          "type": "url",
          "id": "link",
          "label": "t:sections.banner_v3.blocks.slide.link.label"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_v3.presets.name"
    }
  ]
}
{% endschema %}
