2022-04-03 01:20:53 +02:00
|
|
|
<template>
|
2022-07-29 00:52:40 +02:00
|
|
|
<main>
|
2022-08-27 15:08:10 +02:00
|
|
|
<h1 hidden>Page d'accueil</h1>
|
2022-07-29 00:52:40 +02:00
|
|
|
<section class="section">
|
|
|
|
<h2 class="title">La semaine prochaine</h2>
|
2022-12-04 01:26:43 +01:00
|
|
|
<template v-if="firstFilm">
|
|
|
|
<MovieCardFull :film="firstFilm" />
|
|
|
|
</template>
|
2022-07-29 00:52:40 +02:00
|
|
|
</section>
|
|
|
|
<section v-if="nextFilms.length" class="section is-relative">
|
|
|
|
<h2 class="title">Et après</h2>
|
2023-01-28 22:21:27 +01:00
|
|
|
<div class="is-flex next-films">
|
|
|
|
<MovieCardShort v-for="film of nextFilms" :key="film.id" :film="film" />
|
|
|
|
</div>
|
|
|
|
<div class="is-flex mt-5">
|
|
|
|
<nuxt-link class="ml-auto" to="/calendrier?view=future">
|
|
|
|
Voir plus
|
|
|
|
</nuxt-link>
|
|
|
|
</div>
|
2022-07-29 00:52:40 +02:00
|
|
|
</section>
|
|
|
|
</main>
|
2022-04-03 01:20:53 +02:00
|
|
|
</template>
|
|
|
|
|
2022-07-11 01:31:21 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { Film } from "~/composables/types"
|
2022-07-29 00:49:27 +02:00
|
|
|
|
2022-12-30 22:34:43 +01:00
|
|
|
useHead({ title: "Accueil" })
|
2022-07-11 01:31:21 +02:00
|
|
|
|
2022-07-14 01:39:19 +02:00
|
|
|
const films = ref<Film[]>()
|
2022-12-31 03:59:18 +01:00
|
|
|
films.value = ((await apiGet<Film[]>(`films/home/`)).data.value || []) as Film[]
|
2022-12-04 01:26:43 +01:00
|
|
|
const firstFilm = computed(() => films.value?.[0])
|
|
|
|
const nextFilms = computed(() => films.value?.slice(1))
|
2022-07-11 01:31:21 +02:00
|
|
|
</script>
|
2022-07-25 00:52:05 +02:00
|
|
|
|
|
|
|
<style lang="sass">
|
2023-01-28 22:21:27 +01:00
|
|
|
.next-films
|
|
|
|
flex-wrap: wrap
|
|
|
|
justify-content: space-evenly
|
|
|
|
margin-bottom: -3rem
|
|
|
|
> *
|
|
|
|
flex: 0 0 31rem
|
|
|
|
margin-bottom: 3rem
|
|
|
|
&:not(:last-child)
|
|
|
|
margin-right: 3rem
|
2022-07-25 00:52:05 +02:00
|
|
|
</style>
|