{% set slides = [1, 2, 3] %}

{% set actions = [
  { label: 'En savoir plus', src: 'https://picsum.photos/200/400?rand=1*' },
  { label: 'En savoir plus', src: 'https://picsum.photos/500/400?rand=1*' }
] %}

<style type="text/css">
  .is-active { background-color: white}

  html { overflow: hidden; }
</style>

{% embed '@ui/organisms/Hero/Hero.twig'
  with {
    surtitle: 'Surtitre',
    surtitle_attr: { class: 'italic' },
    title: 'Lorem ipsum dolor sit amet, consectetur.',
    title_attr: { class: 'text-5xl uppercase font-bold' },
    content_position: 'left',
    description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Facilisi tempor, dignissim diam egestas habitant aliquet. Etiam ac a at mattis pellentesque felis, in phasellus.',
    actions: actions,
    attr: {
      data_component: 'Slider',
      data_option_mode: 'left',
      data_option_fit_bounds: true,
      data_option_contain: true,
      class: 'w-full h-screen overflow-hidden'
    },
    content_attr: {
      class: 'relative flex-col h-1/3 w-2/3 pl-12 justify-between'
    }
  }
%}
  {% block background %}

  {% endblock %}
  {% block content %}
    <div data-componemt="SliderDrag"
      data-ref="wrapper"
      tabindex="0"
      class="h-full w-full flex">
      {% for slide in slides %}
        <div class="h-full min-w-full relative flex items-center"
          data-component="SliderItem">
          {% include '@ui/atoms/Figure/Figure.twig' with {
            src: 'https://picsum.photos/1200/900?rand=' ~ slide,
            width: 1200,
            height: 900,
            absolute: true,
            fit: 'cover',
            attr: {
              data_option_enter_from: 'opacity-0 transform scale-110',
              data_option_enter_active: 'transition duration-1000 ease-out-expo',
              class: 'absolute top-0 left-0 h-full w-full'
            },
            inner_attr: { class: 'bg-vp-bg' },
            img_attr: { class: 'opacity-0 transform scale-110' }
          } only %}
          {{ parent() }}
        </div>
      {% endfor %}
    </div>
  {% endblock %}
  {% block after %}
    <div class="absolute bottom-0 w-full p-12 flex justify-between items-center">
      <div data-component="SliderDots"
        class="space-x-4 flex"
        data-option-enter-to="is-active">
        {% for slides in slides %}
          <button type="button"
            data-ref="dots[]"
            class="relative w-3 flex-wrap h-3 bg-black rounded-full">
            <span class="sr-only">Go to slide #{{ loop.index }}</span>
          </button>
        {% endfor %}
      </div>
      <div class="flex space-x-4">
        {% include '@ui/atoms/Button/StyledButtonRounded.twig' with {
          label: 'Secondary',
          theme: 'primary',
          icon: 'chevron',
          icon_only: true,
          attr: { data_component: 'SliderBtn', data_option_prev: true },
          icon_class: ['rotate-90']
        } %}
        {% include '@ui/atoms/Button/StyledButtonRounded.twig' with {
          label: 'Secondary',
          theme: 'primary',
          icon: 'chevron',
          icon_only: true,
          attr: { data_component: 'SliderBtn', data_option_next: true },
          icon_class: ['-rotate-90']
        } %}
      </div>
    </div>
  {% endblock %}
{% endembed %}
