<template>
  <LayoutContainer :overflow="false">
    <v-row justify="center">
      <h2 class="title">
        Plus de 5 000 structures nous font confiance
      </h2>
      <div class="d-flex justify-center align-center">
        <div
          class="carousel-button"
          @click="goPrevious"
        >
          <i class="fas fa-chevron-left" />
        </div>
        <div
          class="carousel-button"
          @click="goNext"
        >
          <i class="fas fa-chevron-right" />
        </div>
      </div>
    </v-row>

    <Carousel
      ref="carousel"
      class="carrousel elevation-6"
      :items-to-show="4"
      :items-to-scroll="2"
    >
      <Slide
        v-for="(item, index) in items"
        :key="index"
      >
        <div class="card">
          <v-img
            class="card-img"
            :src="item.src"
            alt="Card image cap"
          />
        </div>
      </Slide>
    </Carousel>
  </LayoutContainer>
</template>

<script setup>
import { ref } from "vue";
import { Carousel, Slide } from "vue3-carousel";
const carousel = ref(null);

const goPrevious = () => {
  carousel.value.prev();
};

const goNext = () => {
  carousel.value.next();
};
const items = ref([
  { src: "/images/reviews/review1.png" },
  { src: "/images/reviews/review2.png" },
  { src: "/images/reviews/review3.png" },
  { src: "/images/reviews/review4.png" },
  { src: "/images/reviews/review5.png" },
]);
</script>

<style scoped>
.carousel-button i {
  color: black;
}

.carousel-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 2px solid black;
  cursor: pointer;
  margin-right: 1rem;
  margin-top: 1rem;
}
.card-img {
  height: 10rem;
  width: 10rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.carousel {
  background-color: white;
  margin-top: 2rem;
  border-radius: 20px;
  height: 13em;
  width: 60rem;
  margin-left: auto;
  margin-right: auto;
  box-shadow: #071b1f;
}

.title {
  font-family: "Barlow";
  margin-bottom: 2rem;
  font-style: normal;
  text-align: center;
  color: black;
  margin-left: 30rem;
  margin-right: 30rem;
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-size: 42px;
  line-height: 42px;
  text-align: center;
  color: #0e2d32;
}
</style>
