ReviewSection.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <LayoutContainer>
  3. <v-row class="center-90">
  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. </v-card-item>
  40. <v-card-actions>
  41. <p class="reviewer-name">
  42. {{ card.name }}
  43. </p>
  44. <p class="reviewer-status">
  45. {{ card.status }}
  46. </p>
  47. <p class="reviewer-structure">
  48. {{ card.structure }}
  49. </p>
  50. </v-card-actions>
  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-container {
  80. padding: 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. }
  115. }
  116. .carousel {
  117. .v-card {
  118. display: flex;
  119. flex-direction: column;
  120. padding: 0 0.5rem;
  121. border-radius: 1rem;
  122. min-height: 300px;
  123. max-height: 300px;
  124. margin-top: 2rem;
  125. margin-bottom: 0.6rem;
  126. }
  127. .v-card-item {
  128. flex: 1
  129. }
  130. .v-card-text {
  131. text-align: justify;
  132. min-height: 120px;
  133. overflow: auto;
  134. font-size: 0.9rem;
  135. flex: 1;
  136. }
  137. .v-card-actions {
  138. display: flex;
  139. flex-direction: column;
  140. justify-content: center;
  141. align-items: center;
  142. }
  143. .reviewer-name {
  144. font-weight: 500;
  145. font-size: 20px;
  146. line-height: 24px;
  147. color: var(--on-primary-color-alt) !important;
  148. text-align: justify !important;
  149. }
  150. .reviewer-status {
  151. font-weight: 600;
  152. font-size: 12px;
  153. line-height: 16px;
  154. display: flex;
  155. align-items: center;
  156. letter-spacing: 0.18em;
  157. text-transform: uppercase;
  158. text-align: justify !important;
  159. }
  160. .reviewer-structure {
  161. font-weight: 300;
  162. font-size: 0.8rem;
  163. line-height: 14px;
  164. display: flex;
  165. align-items: center;
  166. margin-bottom: 1rem;
  167. }
  168. @media (min-width:2100px) {
  169. .v-card-text {
  170. min-height: 150px !important;
  171. max-height: 150px !important;
  172. }
  173. }
  174. }
  175. .card {
  176. margin-left: 0.5rem;
  177. border-radius: 1rem;
  178. }
  179. @media (min-width:2100px) {
  180. .v-card {
  181. min-height: 360px !important;
  182. max-height: 360px !important;
  183. }
  184. }
  185. </style>