{{ 'section-banner-video-v1.css' | asset_url | stylesheet_tag }}

<section {% render 'section-attr' %}>
  <div class='banner-video-v1'>
    {% if section.settings.video %}
      <div class='banner-video-v1__video'>
        <video src='{{section.settings.video.sources[1].url}}' loop muted playsinline autoplay></video>
        <div class='banner-video-v1__overlay'></div>
      </div>
    {% endif %}
    <div class='banner-video-v1__content'>
      <div class='banner-video-v1__text'>
        {%- if section.settings.subtitle != blank -%}
          <div class='banner-video-v1__subtitle'>{{ section.settings.subtitle }}</div>
        {%- endif -%}
        {%- if section.settings.title != blank -%}
          <div class='banner-video-v1__btn'>
            <div class='banner-video-v1__title'>{{ section.settings.title }}</div>
            <a href='{{ section.settings.url }}' class='banner-video-v1__url'>
              <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'>
                <path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/>
              </svg>
            </a>
          </div>
        {%- endif -%}
      </div>
    </div>
  </div>
</section>

{% schema %}
{
  "name": "t:sections.banner_video_v1.name",
  "tag": "section",
  "class": "section",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.banner_video_v1.settings.heading.label"
    },
    {
      "type": "video",
      "id": "video",
      "label": "t:sections.banner_video_v1.settings.video.label",
      "info": "t:sections.banner_video_v1.settings.video_info.label"
    },
    {
      "type": "text",
      "id": "subtitle",
      "label": "t:sections.banner_video_v1.settings.subtitle.label",
      "default": "Subtitle"
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.banner_video_v1.settings.title.label",
      "default": "Title"
    },
    {
      "type": "url",
      "id": "url",
      "label": "t:sections.banner_video_v1.settings.url.label",
      "default": "/collections/all"
    },
    {
      "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
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_video_v1.presets.name"
    }
  ]
}
{% endschema %}
