Agenda.vue 5.9 KB

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