ReviewSection.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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 0 48px 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-container {
  129. height: 100%;
  130. }
  131. .v-card {
  132. display: flex;
  133. flex-direction: column;
  134. padding: 0 0.5rem;
  135. border-radius: 1rem;
  136. margin-top: 2rem;
  137. margin-bottom: 0.6rem;
  138. height: 100%;
  139. @media (max-width: 1240px) {
  140. max-width: 70%;
  141. margin: 0 auto 48px auto;
  142. }
  143. }
  144. .v-card-item {
  145. flex: 1
  146. }
  147. .v-card-text {
  148. min-height: 120px;
  149. overflow: auto;
  150. font-size: 1rem;
  151. flex: 1;
  152. }
  153. .v-card-actions {
  154. display: flex;
  155. flex-direction: column;
  156. justify-content: center;
  157. align-items: center;
  158. }
  159. .reviewer-name {
  160. font-weight: 500;
  161. font-size: 20px;
  162. line-height: 24px;
  163. color: var(--on-primary-color-alt) !important;
  164. text-align: justify !important;
  165. }
  166. .reviewer-status {
  167. font-weight: 600;
  168. font-size: 12px;
  169. line-height: 16px;
  170. display: flex;
  171. align-items: center;
  172. letter-spacing: 0.18em;
  173. text-transform: uppercase;
  174. @media (min-width: 600px) {
  175. text-align: justify !important;
  176. }
  177. @media (max-width: 600px) {
  178. margin: 12px auto;
  179. text-align: center !important;
  180. }
  181. }
  182. .reviewer-structure {
  183. font-weight: 300;
  184. font-size: 0.8rem;
  185. line-height: 14px;
  186. display: flex;
  187. align-items: center;
  188. margin-bottom: 1rem;
  189. }
  190. @media (max-width: 1240px) {
  191. }
  192. }
  193. .card {
  194. margin-left: 0.5rem;
  195. border-radius: 1rem;
  196. }
  197. .v-card-item {
  198. display: block;
  199. padding-top: 16px;
  200. }
  201. @media (max-width:600px) {
  202. :deep(.v-carousel__controls) {
  203. color: var(--on-neutral-color);
  204. background-color: var(--neutral-color);
  205. }
  206. }
  207. </style>