Clients.vue 2.9 KB

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