Clients.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. v-if="lgAndUp"
  17. icon="fas fa-chevron-left"
  18. @click="goToPrevious"
  19. />
  20. <!-- Carrousel -->
  21. <Carousel
  22. ref="carousel"
  23. class="elevation-4 mb-12"
  24. :items-to-show="smAndUp ? 4 : 1"
  25. :items-to-scroll="smAndUp ? 2 : 1"
  26. :wrap-around="true"
  27. >
  28. <Slide v-for="(item, index) in items" :key="item.src">
  29. <div>
  30. <v-img :src="item.src" :alt="item.alt" />
  31. </div>
  32. </Slide>
  33. </Carousel>
  34. <!-- Fléche de droite -->
  35. <v-btn
  36. v-if="lgAndUp"
  37. icon="fas fa-chevron-right"
  38. @click="goToNext"
  39. />
  40. </v-row>
  41. <v-row v-if="mdAndDown">
  42. <v-btn
  43. icon="fas fa-chevron-left"
  44. @click="goToPrevious"
  45. />
  46. <v-btn
  47. icon="fas fa-chevron-right"
  48. @click="goToNext"
  49. />
  50. </v-row>
  51. </v-container>
  52. </LayoutContainer>
  53. </template>
  54. <script setup lang="ts">
  55. import { Carousel, Slide } from "vue3-carousel";
  56. import type { PropType } from "@vue/runtime-core";
  57. import { useDisplay } from "vuetify";
  58. const { smAndUp, mdAndUp, lgAndUp, mdAndDown } = useDisplay()
  59. const carousel: Ref<typeof Carousel | null> = ref(null);
  60. const props = defineProps({
  61. items: {
  62. type: Array as PropType<Array<{ src: string, alt: string }>>,
  63. required: true
  64. }
  65. });
  66. const goToPrevious = () => {
  67. carousel.value!.prev();
  68. };
  69. const goToNext = () => {
  70. carousel.value!.next();
  71. };
  72. </script>
  73. <style scoped lang="scss">
  74. .v-row {
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. max-width: 1300px;
  79. margin-right: auto;
  80. margin-left: auto;
  81. }
  82. h3 {
  83. margin-bottom: 2rem;
  84. text-align: center;
  85. font-weight: 600;
  86. font-size: 42px;
  87. line-height: 42px;
  88. color: var(--on-primary-color);
  89. width: 50%;
  90. @media (max-width: 1240px) {
  91. width: 70%;
  92. }
  93. }
  94. .alt-color {
  95. color: var(--on-primary-color-alt) !important;
  96. }
  97. .v-btn {
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. width: 60px;
  102. height: 60px;
  103. background-color: transparent;
  104. color: var(--on-primary-color);
  105. border: 2px solid;
  106. border-color: var(--on-primary-color);
  107. cursor: pointer;
  108. margin-right: 1rem;
  109. margin-top: 1rem;
  110. border-radius: 0;
  111. }
  112. .carousel {
  113. width: 960px;
  114. height: 240px;
  115. background-color: var(--neutral-color);
  116. margin-top: 2rem;
  117. border-radius: 20px;
  118. margin-left: auto;
  119. margin-right: auto;
  120. box-shadow: var(--primary-color);
  121. @media (max-width: 1240px) {
  122. width: 50%;
  123. min-width: 600px;
  124. }
  125. @media (max-width: 1240px) {
  126. width: 90%;
  127. min-width: 90%;
  128. }
  129. }
  130. .v-img {
  131. height: 10rem;
  132. width: 10rem;
  133. margin: 2rem auto;
  134. }
  135. </style>