

<section {% render 'section-attr' %}>
  <xo-container {% render 'section-layout' %}>
    <xo-animate xo-cascade>
      <h2 class='image-comparison-v2__title'>{{ section.settings.title }}</h2>
    </xo-animate>
    <xo-animate xo-cascade class='image-comparison-v2__description'>
      {{ section.settings.description }}
    </xo-animate>
    <xo-animate xo-cascade>
      <xo-image-comparison>
        <xo-image-comparison-before class='image-comparison-v2__image-before' style='--position-y: {{ section.settings.image_before_position }}px'>
          {% render 'image', image: section.settings.image_before , lazyload: false %}
          <xo-image-comparison-label class='image-comparison-v2__label-before'>{{ section.settings.text_before }}</xo-image-comparison-label>
        </xo-image-comparison-before>

        <xo-image-comparison-after class='image-comparison-v2__image-after' style='--position-y: {{ section.settings.image_after_position }}px'>
          {% render 'image', image: section.settings.image_after , lazyload: false %}
          <xo-image-comparison-label class='image-comparison-v2__label-after'>{{ section.settings.text_after }}</xo-image-comparison-label>
        </xo-image-comparison-after>

        <xo-image-comparison-handle class='image-comparison-v2__handle'>
          <xo-image-comparison-handle-icon>
            <span class='image-comparison-v2__beer-handle'></span>
          </xo-image-comparison-handle-icon>
        </xo-image-comparison-handle>
      </xo-image-comparison>
    </xo-animate>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.image_comparison_v1.name",
  "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": "number",
      "id": "fullwidth_margin",
      "label": "t:sections.all.fullwidth_margin.label",
      "default": 0,
      "visible_if": "{{ section.settings.width == 'fullwidth' }}"
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.image_comparison_v1.settings.title.label",
      "default": "Title"
    },
    {
      "type": "text",
      "id": "description",
      "label": "t:sections.image_comparison_v1.settings.description.label",
      "default": "Description"
    },
    {
      "type": "text",
      "id": "text_before",
      "label": "t:sections.image_comparison_v1.settings.text_before.label",
      "default": "Before"
    },
    {
      "type": "image_picker",
      "id": "image_before",
      "label": "t:sections.image_comparison_v1.settings.image_before.label",
      "info": "Support jpg, jpeg, png, svg"
    },
    {
      "type": "range",
      "id": "image_before_position",
      "min": -300,
      "max": 0,
      "step": 10,
      "unit": "px",
      "label": "t:sections.image_comparison_v1.settings.image_before_position.label",
      "default": 0
    },
    {
      "type": "text",
      "id": "text_after",
      "label": "t:sections.image_comparison_v1.settings.text_after.label",
      "default": "After"
    },
    {
      "type": "image_picker",
      "id": "image_after",
      "label": "t:sections.image_comparison_v1.settings.image_after.label",
      "info": "Support jpg, jpeg, png, svg"
    },
    {
      "type": "range",
      "id": "image_after_position",
      "min": -300,
      "max": 0,
      "step": 10,
      "unit": "px",
      "label": "t:sections.image_comparison_v1.settings.image_after_position.label",
      "default": 0
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "select",
      "id": "background_type",
      "label": "t:sections.all.background_type.label",
      "options": [
        {
          "value": "color",
          "label": "t:sections.all.background_type.option__1.label"
        },
        {
          "value": "gradient",
          "label": "t:sections.all.background_type.option__2.label"
        },
        {
          "value": "image",
          "label": "t:sections.all.background_type.option__3.label"
        },
        {
          "value": "video",
          "label": "t:sections.all.background_type.option__4.label"
        }
      ],
      "default": "color"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.background_color.label",
      "alpha": true,
      "visible_if": "{{ section.settings.background_type == 'color' }}"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.background_gradient.label",
      "visible_if": "{{ section.settings.background_type == 'gradient' }}"
    },
    {
      "type": "number",
      "id": "background_margin",
      "label": "t:sections.all.background_margin.label",
      "default": 0
    },
    {
      "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
    }
  ],
  "presets": [
    {
      "name": "t:sections.image_comparison_v1.presets.name"
    }
  ]
}
{% endschema %}
