ReviewSection.vue 4.4 KB

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