ReviewSection.vue 4.3 KB

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