ReviewSection.vue 4.9 KB

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