ReviewSection.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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 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. <Carousel
  23. ref="carousel"
  24. :items-to-show="lgAndUp ? 3 : 1"
  25. :wrapAround="true"
  26. :show-arrows="false"
  27. snapAlign="center"
  28. class="carousel"
  29. >
  30. <Slide
  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. <i>"{{ card.review }}"</i>
  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. </Slide>
  56. </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. @media (max-width: 1240px) {
  119. margin-top: 2rem;
  120. margin-bottom: 1rem;
  121. }
  122. }
  123. }
  124. .carousel {
  125. @media (max-width: 1240px) {
  126. left: -36px;
  127. }
  128. .v-card {
  129. display: flex;
  130. flex-direction: column;
  131. padding: 0 0.5rem;
  132. border-radius: 1rem;
  133. min-height: 300px;
  134. max-height: 300px;
  135. margin-top: 2rem;
  136. margin-bottom: 0.6rem;
  137. @media (max-width: 1240px) {
  138. max-width: 70%;
  139. margin: 0 auto 48px auto;
  140. }
  141. }
  142. .v-card-item {
  143. flex: 1
  144. }
  145. .v-card-text {
  146. min-height: 120px;
  147. overflow: auto;
  148. font-size: 1rem;
  149. flex: 1;
  150. }
  151. .v-card-actions {
  152. display: flex;
  153. flex-direction: column;
  154. justify-content: center;
  155. align-items: center;
  156. }
  157. .reviewer-name {
  158. font-weight: 500;
  159. font-size: 20px;
  160. line-height: 24px;
  161. color: var(--on-primary-color-alt) !important;
  162. text-align: justify !important;
  163. }
  164. .reviewer-status {
  165. font-weight: 600;
  166. font-size: 12px;
  167. line-height: 16px;
  168. display: flex;
  169. align-items: center;
  170. letter-spacing: 0.18em;
  171. text-transform: uppercase;
  172. @media (min-width: 600px) {
  173. text-align: justify !important;
  174. }
  175. @media (max-width: 600px) {
  176. margin: 12px auto;
  177. text-align: center !important;
  178. }
  179. }
  180. .reviewer-structure {
  181. font-weight: 300;
  182. font-size: 0.8rem;
  183. line-height: 14px;
  184. display: flex;
  185. align-items: center;
  186. margin-bottom: 1rem;
  187. }
  188. @media (min-width:2100px) {
  189. .v-card-text {
  190. min-height: 150px !important;
  191. max-height: 150px !important;
  192. }
  193. }
  194. @media (max-width: 1240px) {
  195. }
  196. }
  197. .card {
  198. margin-left: 0.5rem;
  199. border-radius: 1rem;
  200. @media (max-width:1240px) {
  201. //margin-left: 15%;
  202. //max-width: 70%;
  203. }
  204. }
  205. .v-card-item {
  206. display: block;
  207. padding-top: 16px;
  208. }
  209. @media (min-width:2100px) {
  210. .v-card {
  211. min-height: 360px !important;
  212. max-height: 360px !important;
  213. }
  214. }
  215. @media (max-width:600px) {
  216. :deep(.v-carousel__controls) {
  217. color: var(--on-neutral-color);
  218. background-color: var(--neutral-color);
  219. }
  220. }
  221. </style>