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

<section {% render 'section-attr' %}>
  {% render 'section-bg-image' %}
  <xo-container {% render 'section-layout' %}>
    <xo-grid style='--xs: 1; --md: 2'>
      <div>
        <xo-animate xo-cascade class='instagram-v7__subtitle-wrap'>
          <span class='instagram-v7__icon'>{{ section.settings.icon }}</span>
          <span class='instagram-v7__subtitle'>{{ section.settings.subtitle }}</span>
        </xo-animate>
        <xo-animate xo-cascade class='instagram-v7__title'>
          <h2>{{ section.settings.title }}</h2>
        </xo-animate>
        <xo-animate xo-cascade class='instagram-v7__description'>{{ section.settings.description }}</xo-animate>
        <xo-animate xo-cascade class='instagram-v7__button'>
          {% render 'button',
            text: section.settings.button_text,
            link: section.settings.button_link,
            mode: section.settings.button_mode,
            style: section.settings.button_style,
            size: section.settings.button_size,
            radius: section.settings.button_radius,
            padding: section.settings.button_padding
          %}
        </xo-animate>
      </div>
      <xo-animate
        xo-cascade
        {% if section.settings.reverse %}
          style='--order-md: -1'
        {% endif %}
      >
        <xo-instagram
          xo-limit='2'
          xo-open-mode='{{ section.settings.open_mode }}'
          xo-access-token='{{ section.settings.access_token }}'
        >
          <div class='instagram-v7__grid'>
            {% if section.settings.access_token == blank %}
              {% for i in (1..2) %}
                <div class='instagram-v7__item'>
                  <img src='{{ 'instagram' | append: i | append: '.jpg' | file_img_url: 'master' }}' class='instagram-v7__image' alt='instagram' width='1000' height='1000'>
                  <a href='https://www.instagram.com/' class='instagram-v7__image-layer' target='_blank'>
                    {{ section.settings.icon }}
                  </a>
                </div>
              {% endfor %}
            {% else %}
              <xo-instagram-template>
                <img class='instagram-v7__image' data-src='{ url }' alt='' width='1000' height='1000'>
                <span class='instagram-v7__image-layer'>{{ section.settings.icon }}</span>
              </xo-instagram-template>
            {% endif %}
          </div>
        </xo-instagram>
      </xo-animate>
    </xo-grid>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.instagram_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": "reverse",
      "label": "t:sections.instagram_v3.settings.reverse.label",
      "default": false
    },
    {
      "type": "text",
      "id": "subtitle",
      "label": "t:sections.instagram_v3.settings.subtitle.label",
      "default": "INSTAGRAM"
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.instagram_v3.settings.title.label",
      "default": "Follow us @August"
    },
    {
      "type": "text",
      "id": "description",
      "label": "t:sections.instagram_v3.settings.description.label",
      "default": "Sarah Flint shoes make sure that you feel both feminine and powerful, because to be one is to be the other. Show us how you #august today."
    },
    {
      "type": "text",
      "id": "access_token",
      "label": "t:sections.instagram_v3.settings.access_token.label",
      "info": "t:sections.instagram_v3.settings.access_token.info"
    },
    {
      "type": "select",
      "id": "open_mode",
      "label": "t:sections.instagram_v3.settings.open_mode.label",
      "default": "newtab",
      "options": [
        {
          "label": "t:sections.instagram_v3.settings.open_mode.option_1.label",
          "value": "modal"
        },
        {
          "label": "t:sections.instagram_v3.settings.open_mode.option_2.label",
          "value": "newtab"
        }
      ]
    },
    {
      "type": "html",
      "id": "icon",
      "label": "t:sections.instagram_v3.settings.icon.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z\"/></svg>"
    },
    {
      "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"
        },
        {
          "value": "accent",
          "label": "t:sections.all.button_mode.option__3.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": "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
    }
  ],
  "presets": [
    {
      "name": "t:sections.instagram_v3.presets.name"
    }
  ]
}
{% endschema %}
