ReviewSection.vue 4.6 KB

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