ReviewSection.client.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <LayoutContainer>
  3. <v-row class="center-90">
  4. <v-col cols="12" lg="3">
  5. <div class="controls-section">
  6. <h3>Ce sont eux qui en parlent le mieux</h3>
  7. <div class="carousel-controls">
  8. <v-btn
  9. icon="fas fa-chevron-left"
  10. aria-label="Précédent"
  11. @click="goPrevious"
  12. />
  13. <v-btn
  14. icon="fas fa-chevron-right"
  15. aria-label="Suivant"
  16. @click="goNext"
  17. />
  18. </div>
  19. </div>
  20. </v-col>
  21. <v-col cols="12" lg="9">
  22. <Carousel
  23. ref="carousel"
  24. :items-to-show="lgAndUp ? 3 : 1"
  25. :wrap-around="true"
  26. :show-arrows="false"
  27. snap-align="center"
  28. class="carousel"
  29. >
  30. <Slide v-for="(card, index) in cards" :key="index" class="card">
  31. <v-container>
  32. <v-card class="inv-theme">
  33. <v-card-item>
  34. <v-card-text>
  35. <i>"{{ card.review }}"</i>
  36. </v-card-text>
  37. </v-card-item>
  38. <v-card-actions>
  39. <p class="reviewer-name">
  40. {{ card.name }}
  41. </p>
  42. <p class="reviewer-status">
  43. {{ card.status }}
  44. </p>
  45. <p class="reviewer-structure">
  46. {{ card.structure }}
  47. </p>
  48. </v-card-actions>
  49. </v-card>
  50. </v-container>
  51. </Slide>
  52. </Carousel>
  53. </v-col>
  54. </v-row>
  55. </LayoutContainer>
  56. </template>
  57. <script setup lang="ts">
  58. import { Carousel, Slide } from 'vue3-carousel'
  59. import 'vue3-carousel/dist/carousel.css'
  60. import type { PropType, Ref } from 'vue'
  61. import { useDisplay } from 'vuetify'
  62. import type { Review } from '~/types/interface'
  63. defineProps({
  64. cards: {
  65. type: Array as PropType<Array<Review>>,
  66. required: true,
  67. },
  68. })
  69. const { lgAndUp } = useDisplay()
  70. const carousel: Ref<typeof Carousel | null> = ref(null)
  71. const goPrevious = () => {
  72. carousel.value!.prev()
  73. }
  74. const goNext = () => {
  75. carousel.value!.next()
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .v-container {
  80. padding: 0 0 48px 0 !important;
  81. }
  82. .controls-section {
  83. display: flex;
  84. flex-direction: column;
  85. justify-content: space-between;
  86. height: 100%;
  87. h3 {
  88. font-weight: 600;
  89. font-size: 42px;
  90. line-height: 42px;
  91. margin-left: 1rem;
  92. margin-right: 1rem;
  93. margin-top: 3rem;
  94. text-align: center;
  95. }
  96. .carousel-controls {
  97. display: flex;
  98. flex-direction: row;
  99. justify-content: center;
  100. align-items: center;
  101. }
  102. .v-btn {
  103. display: flex;
  104. justify-content: center;
  105. align-items: center;
  106. width: 60px;
  107. height: 60px;
  108. background-color: transparent;
  109. border: 2px solid var(--on-standard-theme);
  110. cursor: pointer;
  111. margin-right: 1rem;
  112. margin-bottom: 2rem;
  113. border-radius: 0;
  114. @media (max-width: 1240px) {
  115. margin-top: 2rem;
  116. margin-bottom: 1rem;
  117. }
  118. }
  119. }
  120. .carousel {
  121. @media (max-width: 1240px) {
  122. left: -36px;
  123. }
  124. .v-container {
  125. height: 100%;
  126. }
  127. .v-card {
  128. display: flex;
  129. flex-direction: column;
  130. padding: 0 0.5rem;
  131. border-radius: 1rem;
  132. margin-top: 2rem;
  133. margin-bottom: 0.6rem;
  134. height: 100%;
  135. @media (max-width: 1240px) {
  136. max-width: 70%;
  137. margin: 0 auto 48px auto;
  138. }
  139. @media (max-width: 600px) {
  140. height: 100%;
  141. }
  142. }
  143. .v-card-item {
  144. flex: 1;
  145. @media (max-width: 600px) {
  146. flex: 0;
  147. }
  148. }
  149. .v-card-text {
  150. min-height: 120px;
  151. overflow: auto;
  152. font-size: 1rem;
  153. flex: 1;
  154. }
  155. .v-card-actions {
  156. display: flex;
  157. flex-direction: column;
  158. justify-content: center;
  159. align-items: center;
  160. }
  161. .reviewer-name {
  162. font-weight: 500;
  163. font-size: 20px;
  164. line-height: 24px;
  165. color: var(--on-primary-color-alt) !important;
  166. text-align: justify !important;
  167. }
  168. .reviewer-status {
  169. font-weight: 600;
  170. font-size: 12px;
  171. line-height: 16px;
  172. display: flex;
  173. align-items: center;
  174. letter-spacing: 0.18em;
  175. text-transform: uppercase;
  176. @media (min-width: 600px) {
  177. text-align: justify !important;
  178. }
  179. @media (max-width: 600px) {
  180. margin: 12px auto;
  181. text-align: center !important;
  182. }
  183. }
  184. .reviewer-structure {
  185. font-weight: 300;
  186. font-size: 0.8rem;
  187. line-height: 14px;
  188. display: flex;
  189. align-items: center;
  190. margin-bottom: 1rem;
  191. }
  192. @media (max-width: 1240px) {
  193. }
  194. }
  195. .card {
  196. margin-left: 0.5rem;
  197. border-radius: 1rem;
  198. }
  199. .v-card-item {
  200. display: block;
  201. padding-top: 16px;
  202. }
  203. @media (max-width: 600px) {
  204. :deep(.v-carousel__controls) {
  205. color: var(--on-neutral-color);
  206. background-color: var(--neutral-color);
  207. }
  208. }
  209. </style>