ReviewSection.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. <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-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-item {
  118. display: flex;
  119. flex-direction: column;
  120. justify-content: space-between;
  121. height: 100%;
  122. }
  123. .v-card-text {
  124. text-align: justify;
  125. min-height: 200px;
  126. max-height: 200px;
  127. overflow: auto;
  128. font-size: 0.9rem;
  129. }
  130. footer {
  131. min-height: 100px;
  132. display: flex;
  133. flex-direction: column;
  134. justify-content: center;
  135. align-items: center;
  136. margin-top: 1rem;
  137. }
  138. .v-card-actions {
  139. font-weight: 500;
  140. font-size: 20px;
  141. line-height: 24px;
  142. color: var(--on-primary-color-alt) !important;
  143. margin-top: 5rem;
  144. text-align: justify !important;
  145. }
  146. .reviewer-status {
  147. font-weight: 600;
  148. font-size: 12px;
  149. line-height: 16px;
  150. display: flex;
  151. align-items: center;
  152. letter-spacing: 0.18em;
  153. text-transform: uppercase;
  154. text-align: justify !important;
  155. }
  156. .reviewer-structure {
  157. font-weight: 300;
  158. font-size: 0.8rem;
  159. line-height: 14px;
  160. display: flex;
  161. align-items: center;
  162. margin-bottom: 1rem;
  163. }
  164. @media (min-width:2100px) {
  165. .v-card-text {
  166. min-height: 150px !important;
  167. max-height: 150px !important;
  168. }
  169. }
  170. }
  171. .card {
  172. margin-left: 0.5rem;
  173. border-radius: 1rem;
  174. }
  175. .v-card {
  176. padding: 0 0.5rem;
  177. border-radius: 1rem;
  178. min-height: 450px;
  179. max-height: 450px;
  180. margin-top: 2rem;
  181. margin-bottom: 0.6rem;
  182. }
  183. @media (min-width:2100px) {
  184. .v-card {
  185. min-height: 360px !important;
  186. max-height: 360px !important;
  187. }
  188. }
  189. </style>