Agenda.vue 5.8 KB

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