2022-07-11 01:31:21 +02:00
|
|
|
<template>
|
2022-07-13 00:37:49 +02:00
|
|
|
<div v-if="film">
|
2022-07-22 00:48:31 +02:00
|
|
|
<div class="card movie-card">
|
2023-03-10 18:18:21 +01:00
|
|
|
<header class="card-content is-hidden-tablet">
|
|
|
|
<h3 class="title is-4 mr-4">{{ film.title }}</h3>
|
|
|
|
<div class="subtitle is-5">{{ film.director }}</div>
|
|
|
|
</header>
|
|
|
|
<header class="is-flex">
|
|
|
|
<div
|
|
|
|
class="poster-container is-hidden-tablet"
|
|
|
|
:style="{ '--poster-url': `url(${film.posterLink})` }"
|
|
|
|
>
|
|
|
|
<figure class="image m-auto">
|
|
|
|
<img :src="film.posterLink" alt="Affiche du film" />
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
<div class="card-content">
|
|
|
|
<div class="is-flex is-flex-direction-column">
|
|
|
|
<ButtonIcon
|
|
|
|
v-if="film.trailerLink"
|
|
|
|
label="Bande-annonce"
|
|
|
|
icon="ri-play-circle-fill"
|
|
|
|
class="is-primary is-outlined mb-4 ml-auto is-hidden-tablet"
|
|
|
|
@click="showTrailerModal = true"
|
|
|
|
/>
|
2022-07-13 00:37:49 +02:00
|
|
|
<div
|
2023-03-10 18:18:21 +01:00
|
|
|
class="is-hidden-mobile mb-5 is-flex is-justify-content-space-between is-align-items-center"
|
2022-07-13 00:37:49 +02:00
|
|
|
>
|
2023-03-10 18:18:21 +01:00
|
|
|
<div>
|
|
|
|
<h3 class="title is-4 is-inline mr-4 mb-0">{{ film.title }}</h3>
|
|
|
|
<div class="subtitle is-5 is-inline mb-0">
|
|
|
|
{{ film.director }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ButtonIcon
|
|
|
|
v-if="film.trailerLink"
|
|
|
|
label="Bande-annonce"
|
|
|
|
icon="ri-play-circle-fill"
|
|
|
|
class="is-primary is-outlined"
|
|
|
|
@click="showTrailerModal = true"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field is-grouped is-grouped-multiline">
|
|
|
|
<div
|
|
|
|
v-for="(tag, index) of headerTags"
|
|
|
|
:key="index"
|
|
|
|
class="control"
|
|
|
|
>
|
|
|
|
<div class="tags has-addons">
|
|
|
|
<span v-if="tag.label" class="tag">{{ tag.label }}</span>
|
|
|
|
<span class="tag is-primary">{{ tag.value }}</span>
|
|
|
|
</div>
|
2022-07-13 00:37:49 +02:00
|
|
|
</div>
|
2022-07-11 01:31:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-13 00:37:49 +02:00
|
|
|
</header>
|
|
|
|
<div class="is-flex">
|
|
|
|
<div
|
2023-03-10 18:18:21 +01:00
|
|
|
class="poster-container is-hidden-mobile"
|
2022-07-13 00:37:49 +02:00
|
|
|
:style="{ '--poster-url': `url(${film.posterLink})` }"
|
|
|
|
>
|
2022-07-13 00:51:00 +02:00
|
|
|
<figure class="image m-auto">
|
2022-07-13 00:37:49 +02:00
|
|
|
<img :src="film.posterLink" alt="Affiche du film" />
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
<div class="card-content">
|
2023-01-29 01:13:14 +01:00
|
|
|
<div class="content movie-content">
|
2023-03-10 18:18:21 +01:00
|
|
|
<p
|
|
|
|
v-if="film.projectionComment"
|
|
|
|
class="block has-text-centered has-text-weight-bold is-italic"
|
|
|
|
>
|
|
|
|
{{ film.projectionComment }}
|
|
|
|
</p>
|
2022-07-13 00:51:00 +02:00
|
|
|
<p v-if="film.actors && film.actors.length" class="block">
|
2022-07-13 00:37:49 +02:00
|
|
|
<span class="has-text-weight-bold">Acteurs :</span>
|
|
|
|
{{ film.actors.join(", ") }}
|
|
|
|
</p>
|
2022-07-13 00:51:00 +02:00
|
|
|
<p v-if="film.synopsis" class="block">
|
2022-07-13 00:37:49 +02:00
|
|
|
<span class="has-text-weight-bold">Synopsis :</span>
|
|
|
|
{{ film.synopsis }}
|
|
|
|
</p>
|
|
|
|
</div>
|
2022-07-11 01:31:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-13 00:37:49 +02:00
|
|
|
<footer class="card-content is-flex">
|
2023-03-10 18:18:21 +01:00
|
|
|
<time
|
|
|
|
class="title is-4 mb-4 is-hidden-tablet"
|
|
|
|
:datetime="film.projectionDate"
|
|
|
|
>
|
|
|
|
{{ prettyDate.short(film.projectionDate) }}
|
|
|
|
</time>
|
|
|
|
<time
|
|
|
|
class="title is-4 mb-0 is-hidden-mobile"
|
|
|
|
:datetime="film.projectionDate"
|
|
|
|
>
|
|
|
|
{{ prettyDate.full(film.projectionDate) }}
|
|
|
|
</time>
|
2022-07-13 00:37:49 +02:00
|
|
|
<div class="buttons">
|
|
|
|
<template v-if="isPast">
|
|
|
|
<ButtonIcon
|
|
|
|
label="Lire notre analyse"
|
|
|
|
icon="ri-double-quotes-l"
|
|
|
|
class="is-outlined is-primary"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
2022-07-13 02:18:06 +02:00
|
|
|
<a
|
2022-07-13 00:51:00 +02:00
|
|
|
v-if="film.facebookEventLink"
|
2022-07-13 02:18:06 +02:00
|
|
|
:href="film.facebookEventLink"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
target="_blank"
|
2022-12-25 23:56:01 +01:00
|
|
|
tabindex="-1"
|
2022-07-13 02:18:06 +02:00
|
|
|
>
|
|
|
|
<ButtonIcon
|
|
|
|
label="Événement Facebook"
|
|
|
|
icon="ri-facebook-box-fill"
|
|
|
|
class="is-outlined is-primary"
|
|
|
|
/>
|
|
|
|
</a>
|
2023-03-10 18:18:21 +01:00
|
|
|
<!-- TODO
|
2022-07-13 00:37:49 +02:00
|
|
|
<ButtonIcon
|
2023-03-10 18:18:21 +01:00
|
|
|
v-if="film.icsDownload"
|
|
|
|
label="Ajouter au calendrier"
|
|
|
|
icon="ri-calendar-event-fill"
|
|
|
|
class="is-outlined is-primary"
|
|
|
|
/>
|
|
|
|
-->
|
2022-07-13 00:37:49 +02:00
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</footer>
|
2022-07-11 01:31:21 +02:00
|
|
|
</div>
|
2022-07-13 00:37:49 +02:00
|
|
|
<MovieCardTrailerModal
|
|
|
|
v-if="showTrailerModal"
|
|
|
|
:url="film.trailerLink"
|
|
|
|
:iframe-id="`film-card-${film.id}`"
|
|
|
|
@close="showTrailerModal = false"
|
|
|
|
/>
|
2023-03-10 18:18:21 +01:00
|
|
|
<!-- TODO responsive modal video cf MSF -->
|
2022-07-11 01:31:21 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { Film } from "~/composables/types"
|
|
|
|
import { PropType } from "@vue/runtime-core"
|
2022-07-13 01:02:23 +02:00
|
|
|
import { prettyDate } from "~/composables/strUtils"
|
2022-07-11 01:31:21 +02:00
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
film: { type: Object as PropType<Film>, required: true },
|
|
|
|
})
|
|
|
|
const isPast = ref<boolean>(false)
|
2022-07-13 00:51:00 +02:00
|
|
|
const showTrailerModal = ref<boolean>(false)
|
2022-07-11 01:31:21 +02:00
|
|
|
|
2022-07-13 00:51:00 +02:00
|
|
|
function generateTags(film: Film) {
|
|
|
|
const res = []
|
|
|
|
if ("isInColor" in film && film.isInColor != null)
|
|
|
|
res.push({
|
|
|
|
value: film.isInColor ? "Couleur" : "Noir et blanc",
|
|
|
|
})
|
2022-07-22 00:48:31 +02:00
|
|
|
if (film?.languageSubtitles)
|
2022-07-13 00:51:00 +02:00
|
|
|
res.push({ label: "Langue", value: film.languageSubtitles })
|
|
|
|
if (film?.duration)
|
|
|
|
res.push({
|
|
|
|
label: "Durée",
|
|
|
|
value: film.duration,
|
|
|
|
})
|
|
|
|
if (film?.releaseYear)
|
|
|
|
res.push({ label: "Sortie", value: film.releaseYear.toString() })
|
|
|
|
if (film?.originCountry)
|
|
|
|
res.push({ label: "Pays", value: film.originCountry })
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerTags = computed<{ label?: string; value: string }[]>(() =>
|
|
|
|
generateTags(props.film)
|
|
|
|
)
|
2022-07-11 01:31:21 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="sass">
|
2022-07-22 00:48:31 +02:00
|
|
|
.movie-card .poster-container
|
2023-03-10 18:18:21 +01:00
|
|
|
max-width: 50%
|
|
|
|
width: 25%
|
|
|
|
// ?
|
|
|
|
// TODO fit poster size
|
|
|
|
@include tablet()
|
|
|
|
width: 200px
|
2023-01-29 01:13:14 +01:00
|
|
|
|
|
|
|
.card .card-content .content.movie-content
|
|
|
|
height: 100%
|
|
|
|
display: flex
|
|
|
|
flex-direction: column
|
|
|
|
white-space: pre-wrap
|
2023-03-10 18:18:21 +01:00
|
|
|
|
|
|
|
.card-content
|
|
|
|
@include mobile()
|
|
|
|
padding: 1rem
|
|
|
|
|
|
|
|
footer.card-content
|
|
|
|
flex-direction: column
|
|
|
|
text-align: center
|
|
|
|
justify-items: center
|
|
|
|
@include tablet()
|
|
|
|
flex-direction: row-reverse
|
|
|
|
justify-content: space-between
|
|
|
|
justify-items: auto
|
2022-07-11 01:31:21 +02:00
|
|
|
</style>
|