Agenda.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <AnchoredSection id="agenda">
  3. <LayoutContainer class="mb-12" >
  4. <v-row class="custom-row align-center my-6">
  5. <v-col cols="4" class="align-center">
  6. <LayoutUITitle>
  7. L'agenda Opentalent
  8. </LayoutUITitle>
  9. </v-col>
  10. <v-col cols="4">
  11. <!-- Factoriser les controles du carousel dans un component -->
  12. <div class="carousel-controls">
  13. <v-btn
  14. icon="fas fa-chevron-left"
  15. @click="goPrevious"
  16. />
  17. <v-btn
  18. icon="fas fa-chevron-right"
  19. @click="goNext"
  20. />
  21. </div>
  22. </v-col>
  23. <v-col cols="4" class="d-flex flex-row flex-1 justify-end align-center">
  24. <v-btn class="btn-news" text>
  25. Voir tous les évènements
  26. </v-btn>
  27. </v-col>
  28. </v-row>
  29. <v-row class="custom-row">
  30. <p class="agenda-details">
  31. Retrouvez tous les évènements culturels autour de chez vous.
  32. </p>
  33. </v-row>
  34. <v-row class="custom-row">
  35. <v-col cols="12">
  36. <Carousel
  37. ref="carousel"
  38. :items-to-show="3"
  39. :items-to-scroll="2"
  40. >
  41. <Slide
  42. v-for="(event, eventIndex) in events"
  43. :key="eventIndex"
  44. class="card"
  45. >
  46. <v-card>
  47. <v-img :src="event.img" cover />
  48. <v-card-title>
  49. {{ event.title }}
  50. </v-card-title>
  51. <v-card-text>
  52. {{ event.localisation }}
  53. </v-card-text>
  54. <footer>
  55. <v-chip-group column>
  56. <v-chip
  57. v-for="(tag, tagIndex) in event.tags"
  58. :key="tagIndex"
  59. :color="tagColor(tag)"
  60. label
  61. >
  62. <span
  63. :class="tagTextColor(tag)"
  64. >
  65. {{ tag }}
  66. </span>
  67. </v-chip>
  68. </v-chip-group>
  69. </footer>
  70. </v-card>
  71. </Slide>
  72. </Carousel>
  73. </v-col>
  74. </v-row>
  75. </LayoutContainer>
  76. </AnchoredSection>
  77. </template>
  78. <script setup lang="ts">
  79. import { Carousel, Slide } from "vue3-carousel";
  80. import "vue3-carousel/dist/carousel.css";
  81. import AnchoredSection from "~/components/Layout/AnchoredSection.vue";
  82. import { Event } from "~/types/interface";
  83. const tagColor = (tag: string) => {
  84. switch (tag) {
  85. case "Payant":
  86. return "red";
  87. case "Gratuit":
  88. return "green";
  89. default:
  90. return "primary";
  91. }
  92. };
  93. const tagTextColor = (tag: string) => {
  94. switch (tag) {
  95. case "Payant":
  96. return "red--text";
  97. case "Gratuit":
  98. return "green--text";
  99. default:
  100. return "black--text";
  101. }
  102. };
  103. const events: Array<Event> = [
  104. {
  105. rdv: "20h00",
  106. title: "LA NUIT DES RÊVES ",
  107. localisation: "FESTIVALDE musique - LONGCHAMP",
  108. date: "21/06/2023",
  109. img: "/images/agenda/agenda2.jpg",
  110. tags: ["Festival", "Musique", "Tout public", "Payant"],
  111. },
  112. {
  113. rdv: "20h00",
  114. title: "LE LAC DES CYGNES",
  115. localisation: "SPECTACLE DE DANSE - PARIS 1",
  116. date: "22/06/2023",
  117. img: "/images/agenda/agenda3.jpg",
  118. tags: ["Festival", "Musique", "Tout public", "Gratuit"],
  119. },
  120. {
  121. rdv: "20h00",
  122. title: "SOLIDAYS 2023 : 23 > 25 juin",
  123. localisation: "ORCHESTRE DE PARIS - PARIS 12",
  124. date: "23/06/2023",
  125. img: "/images/agenda/agenda4.jpg",
  126. tags: ["Festival", "Musique", "Tout public", "Payant"],
  127. },
  128. {
  129. rdv: "20h00",
  130. title: "LE LAC DES CYGNES",
  131. localisation: "FESTIVALDE musique - LONGCHAMP",
  132. date: "24/06/2023",
  133. img: "/images/agenda/agenda5.jpg",
  134. tags: ["Festival", "Musique", "Tout public", "Payant"],
  135. },
  136. {
  137. rdv: "20h00",
  138. title: "SOLIDAYS 2023 : 23 > 25 juin ",
  139. localisation: "SPECTACLE DE DANSE - PARIS 1",
  140. date: "20/06/2023",
  141. img: "/images/agenda/agenda1.jpg",
  142. tags: ["Festival", "Musique", "Tout public", "Payant"],
  143. },
  144. ];
  145. const carousel: Ref<typeof Carousel | null> = ref(null);
  146. const goPrevious = () => carousel.value!.prev();
  147. const goNext = () => carousel.value!.next();
  148. </script>
  149. <style scoped>
  150. .v-container{
  151. padding: 0 !important;
  152. }
  153. .container{
  154. background: #F8F8F8
  155. }
  156. .custom-row {
  157. width: 90%;
  158. margin-left: auto;
  159. margin-right: auto;
  160. }
  161. .carousel-controls {
  162. display: flex;
  163. flex-direction: row;
  164. justify-content: center;
  165. align-items: center;
  166. .v-btn {
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. width: 60px;
  171. height: 60px;
  172. background-color: transparent;
  173. border: 2px solid;
  174. cursor: pointer;
  175. margin-right: 1rem;
  176. margin-bottom: 2rem;
  177. border-radius: 0;
  178. }
  179. }
  180. .btn-news {
  181. color: var(--primary-color);
  182. font-family: "Barlow", serif;
  183. background: transparent;
  184. border: 1px solid var(--primary-color);
  185. border-radius: 6px;
  186. font-style: normal;
  187. font-weight: 600;
  188. text-transform: uppercase;
  189. display: flex;
  190. flex-direction: row;
  191. align-items: center;
  192. padding: 25px;
  193. font-size: 10px;
  194. line-height: 15px;
  195. }
  196. .card {
  197. .v-card {
  198. box-shadow: none !important;
  199. margin-right: 1rem;
  200. text-align: left;
  201. }
  202. .v-img {
  203. border-top-left-radius: 20px;
  204. border-top-right-radius: 20px;
  205. width: 100%;
  206. height: 300px;
  207. img {
  208. background-position: center;
  209. }
  210. }
  211. footer{
  212. display: flex;
  213. text-align: left !important;
  214. .v-chip {
  215. color: white;
  216. border: 1px solid #0e2d32;
  217. border-radius: 3rem;
  218. text-transform: uppercase;
  219. display: flex;
  220. align-items: center;
  221. text-align: center;
  222. }
  223. }
  224. }
  225. .agenda-details {
  226. font-weight: 300;
  227. font-size: 16px;
  228. line-height: 20px;
  229. margin-left: 2rem;
  230. color: #091d20;
  231. margin-bottom: 3rem;
  232. width: 15rem;
  233. }
  234. /* -- Classes dynamiques pour les tags --*/
  235. .black--text {
  236. color: black;
  237. }
  238. .green--text {
  239. color: green;
  240. }
  241. .red--text {
  242. color: red;
  243. }
  244. </style>