{{ 'section-testimonial-v1.css' | asset_url | stylesheet_tag }}

<section {% render 'section-attr' %}>
  <xo-container {% render 'section-layout' %}>
    <xo-animate
      xo-type='fade-up'
      xo-gap='30'
      xo-speed='700'
      xo-delay='200'
      xo-duration='1000'
    >
      <xo-carousel
        class='testimonial-v16_carousel'
        style='--background-image: url({{ section.settings.background_image | img_url: 'master' }})'
        xo-per-view='1'
        {% if section.settings.auto_play %}
          xo-autoplay='5000'
        {% endif %}
        xo-rewind
        xo-gap='30'
        xo-speed='600'
        xo-breakpoints='
          {
            600: {
              perView: 1,
              perMove: 1,
              gap: 10,
            },
            1000: {
              perView: 1,
              perMove: 1,
            }
          }
        '
        xo-render-bullet="<span class='testimonial-v16_carousel-bullet'></span>"
      >
        <xo-carousel-inner style='padding-top: 8rem'>
          <xo-carousel-list class='testimonial-v16_carousel-list'>
            {% for block in section.blocks %}
              {% case block.type %}
                {% when 'review' %}
                  <xo-carousel-slide class='testimonial-v16_carousel-slide'>
                    <div class='testimonial-v16'>
                      <div class='testimonial-v16__content'>
                        <div class='testimonial-v16__author-image'>
                          {% render 'image', image: block.settings.author_avt, width: '100%' %}
                        </div>
                        <div class='testimonial-v16__stars'>
                          {%- if block.settings.stars > 0 -%}
                            <ul class='testimonial-v16__list-star'>
                              {% for i in (1..block.settings.stars) %}
                                <li>{% render 'icon', name: 'star-style2', icon_size: '14', color: ' #efb435' %}</li>
                              {% endfor %}
                            </ul>
                          {%- endif -%}
                        </div>
                        <div class='testimonial-v16__comment'>
                          {{ block.settings.user_comment }}
                        </div>
                        <div class='testimonial-v16__author'>
                          {%- if block.settings.author_name != blank -%}
                            {{ block.settings.author_name }}
                          {%- endif -%}
                          {%- if block.settings.author_job != blank -%}
                            {{ block.settings.author_job }}
                          {%- endif -%}
                        </div>
                      </div>
                    </div>
                  </xo-carousel-slide>
              {% endcase %}
            {% endfor %}
          </xo-carousel-list>
        </xo-carousel-inner>
        <div class='testimonial-v16__arrows'>
          <xo-carousel-prev>
            <div class='testimonial-v16__arrow-btn'>
              <div class='testimonial-v16__icon-before'>
                {%- render 'icon', name: 'arrow-left', icon_size: '15' -%}
              </div>
              <div class='testimonial-v16__icon-after'>
                {%- render 'icon', name: 'arrow-left', icon_size: '15' -%}
              </div>
            </div>
          </xo-carousel-prev>

          <xo-carousel-next>
            <div class='testimonial-v16__arrow-btn'>
              <div class='testimonial-v16__icon-after'>
                {%- render 'icon', name: 'arrow-right', icon_size: '15' -%}
              </div>
              <div class='testimonial-v16__icon-before'>
                {%- render 'icon', name: 'arrow-right', icon_size: '15' -%}
              </div>
            </div>
          </xo-carousel-next>
        </div>
        <xo-carousel-pagination class='testimonial-v16_pagination'> </xo-carousel-pagination>
      </xo-carousel>
    </xo-animate>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.testimonial_v1.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": "auto_play",
      "label": "t:sections.testimonial_v1.settings.auto_play.label",
      "default": true
    },
    {
      "type": "image_picker",
      "id": "background_image",
      "label": "t:sections.testimonial_v1.settings.background_image.label"
    },
    {
      "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": "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": "review",
      "name": "Testimonial",
      "settings": [
        {
          "type": "image_picker",
          "id": "author_avt",
          "label": "t:sections.testimonial_v1.blocks.settings.author_avt.label"
        },
        {
          "type": "range",
          "id": "stars",
          "min": 0,
          "max": 5,
          "step": 1,
          "label": "t:sections.testimonial_v1.blocks.settings.stars.label",
          "info": "Set to zero to disable",
          "default": 5
        },
        {
          "type": "richtext",
          "id": "user_comment",
          "label": "t:sections.testimonial_v1.blocks.settings.user_comment.label",
          "default": "<p>Definitely worth the investment. It’s exactly what I’ve been looking for. This is simply unbelievable! Best. Product. Ever!</p>"
        },
        {
          "type": "text",
          "id": "author_name",
          "label": "t:sections.testimonial_v1.blocks.settings.author_name.label",
          "default": "DANIEN PUKA"
        },
        {
          "type": "text",
          "id": "author_job",
          "label": "t:sections.testimonial_v1.blocks.settings.author_job.label",
          "default": "UX Designer"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.testimonial_v1.presets.name"
    }
  ]
}
{% endschema %}
