ReviewSection.vue 4.4 KB

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