Clients.vue 3.0 KB

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