Clients.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- Carrousel des logos clients -->
  2. <template>
  3. <LayoutContainer>
  4. <!-- Titre -->
  5. <v-row justify="center">
  6. <h3 class="text-center">
  7. <slot name="title">
  8. Plus de <span class="alt-color">5000 structures</span> nous font confiance
  9. </slot>
  10. </h3>
  11. </v-row>
  12. <v-container>
  13. <v-row>
  14. <!-- Fléche de gauche -->
  15. <v-btn
  16. icon="fas fa-chevron-left"
  17. @click="goToPrevious"
  18. />
  19. <!-- Carrousel -->
  20. <Carousel
  21. ref="carousel"
  22. class="elevation-4 mb-12"
  23. :items-to-show="lgAndUp ? 4 : 1"
  24. :items-to-scroll="lgAndUp ? 2 : 1"
  25. >
  26. <Slide v-for="(item, index) in items" :key="index">
  27. <div>
  28. <v-img :src="item.src" alt="Card image cap" />
  29. </div>
  30. </Slide>
  31. </Carousel>
  32. <!-- Fléche de droite -->
  33. <v-btn
  34. icon="fas fa-chevron-right"
  35. @click="goToNext"
  36. />
  37. </v-row>
  38. </v-container>
  39. </LayoutContainer>
  40. </template>
  41. <script setup lang="ts">
  42. import { Carousel, Slide } from "vue3-carousel";
  43. import type { PropType } from "@vue/runtime-core";
  44. import { useDisplay } from "vuetify";
  45. const { lgAndUp } = useDisplay()
  46. const carousel: Ref<typeof Carousel | null> = ref(null);
  47. const props = defineProps({
  48. items: {
  49. type: Array as PropType<Array<{ src: string }>>,
  50. required: true
  51. }
  52. });
  53. const goToPrevious = () => {
  54. carousel.value!.prev();
  55. };
  56. const goToNext = () => {
  57. carousel.value!.next();
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. .v-row {
  62. display: flex;
  63. align-items: center;
  64. justify-content: center;
  65. max-width: 1300px;
  66. margin-right: auto;
  67. margin-left: auto;
  68. }
  69. h3 {
  70. margin-bottom: 2rem;
  71. text-align: center;
  72. font-weight: 600;
  73. font-size: 42px;
  74. line-height: 42px;
  75. color: var(--on-primary-color);
  76. width: 50%;
  77. }
  78. .alt-color {
  79. color: var(--on-primary-color-alt) !important;
  80. }
  81. .v-btn {
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. width: 60px;
  86. height: 60px;
  87. background-color: transparent;
  88. color: var(--on-primary-color);
  89. border: 2px solid;
  90. border-color: var(--on-primary-color);
  91. cursor: pointer;
  92. margin-right: 1rem;
  93. margin-top: 1rem;
  94. border-radius: 0;
  95. }
  96. .carousel {
  97. background-color: var(--neutral-color);
  98. margin-top: 2rem;
  99. border-radius: 20px;
  100. margin-left: auto;
  101. margin-right: auto;
  102. box-shadow: var(--primary-color);
  103. @media (max-width: 1240px) {
  104. width: 50%;
  105. min-width: 180px;
  106. }
  107. }
  108. .v-img {
  109. height: 10rem;
  110. width: 10rem;
  111. margin: 2rem auto;
  112. }
  113. </style>