2024-03-25 01:08:09 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
class="movie-tile"
|
2024-03-27 02:05:32 +00:00
|
|
|
:class="{
|
2024-03-27 02:15:37 +00:00
|
|
|
unstashed: !favorited && pageStash && user && pageStash.user.id === user?.id,
|
2024-03-27 02:05:32 +00:00
|
|
|
}"
|
2024-03-25 01:08:09 +00:00
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="cover-container"
|
|
|
|
:title="movie.title"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
:href="`/movie/${movie.id}/${movie.slug}`"
|
|
|
|
class="cover-link"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
v-if="movie.covers[0]"
|
2024-06-01 22:30:56 +00:00
|
|
|
:src="getPath(movie.covers[0], 'thumbnail')"
|
|
|
|
:style="{ 'background-image': `url(${getPath(movie.covers[0], 'lazy')})` }"
|
2024-03-25 01:08:09 +00:00
|
|
|
class="thumbnail"
|
|
|
|
loading="lazy"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-else
|
2024-06-07 23:26:31 +00:00
|
|
|
src="/img/icons/movie.svg"
|
2024-03-25 01:08:09 +00:00
|
|
|
class="nocover"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
<Heart
|
2024-06-02 03:22:08 +00:00
|
|
|
v-if="showDetails"
|
2024-03-27 01:28:21 +00:00
|
|
|
domain="movies"
|
|
|
|
:item="movie"
|
|
|
|
:show-secondary="false"
|
|
|
|
class="light tiled"
|
2024-03-27 02:05:32 +00:00
|
|
|
@stashed="(stash) => { favorited = stash.id === currentStash.id ? true : favorited; }"
|
|
|
|
@unstashed="(stash) => { favorited = stash.id === currentStash.id ? false : favorited; }"
|
2024-03-25 01:08:09 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2024-05-31 01:48:17 +00:00
|
|
|
<div
|
2024-06-02 03:22:08 +00:00
|
|
|
v-if="showDetails"
|
2024-05-31 01:48:17 +00:00
|
|
|
class="tile-info"
|
|
|
|
>
|
2024-03-25 01:08:09 +00:00
|
|
|
<div class="tile-meta">
|
|
|
|
<div class="channel">
|
|
|
|
<Link
|
|
|
|
:href="movie.channel.isIndependent || !movie.network ? `/${movie.channel.type}/${movie.channel.slug}` : `/${movie.network.type}/${movie.network.slug}`"
|
|
|
|
class="favicon-link"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="movie.channel.isIndependent || !movie.network ? `/logos/${movie.channel.slug}/favicon.png` : `/logos/${movie.network.slug}/favicon.png`"
|
|
|
|
class="favicon"
|
|
|
|
>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link
|
|
|
|
:href="`/${movie.channel.type}/${movie.channel.slug}`"
|
|
|
|
class="nolink channel-link"
|
|
|
|
>{{ movie.channel.name }}</Link>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<time
|
|
|
|
:datetime="movie.effectiveDate.toISOString()"
|
|
|
|
class="date"
|
|
|
|
:class="{ nodate: !movie.date }"
|
2024-08-19 21:31:28 +00:00
|
|
|
>{{ format(movie.effectiveDate, {
|
|
|
|
month: movie.effectiveDate.getFullYear() === currentYear ? 'MMM' : 'MMM y',
|
|
|
|
year: 'y',
|
2024-08-20 00:43:23 +00:00
|
|
|
}[movie.datePrecision] || (movie.effectiveDate.getFullYear() === currentYear ? 'MMM d' : 'MMM d, y')) }}</time>
|
2024-03-25 01:08:09 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<a
|
|
|
|
:href="`/movie/${movie.id}/${movie.slug}`"
|
|
|
|
:title="movie.title"
|
|
|
|
class="title nolink"
|
|
|
|
>{{ movie.title }}</a>
|
|
|
|
|
|
|
|
<ul
|
|
|
|
:title="movie.actors.map((actor) => actor.name).join(', ')"
|
|
|
|
class="actors nolist"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="actor in movie.actors"
|
|
|
|
:key="`actor-${movie.id}-${actor.slug}`"
|
|
|
|
class="actor-item"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
:href="`/actor/${actor.id}/${actor.slug}`"
|
|
|
|
class="actor nolink"
|
|
|
|
>{{ actor.name }}</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<ul
|
|
|
|
:title="movie.tags.map((tag) => tag.name).join(', ')"
|
|
|
|
class="tags nolist"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="tag in movie.tags"
|
|
|
|
:key="`tag-${movie.id}-${tag.slug}`"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
:href="`/tag/${tag.slug}`"
|
|
|
|
class="tag nolink"
|
|
|
|
>{{ tag.name }}</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2024-05-31 01:48:17 +00:00
|
|
|
|
|
|
|
<a
|
|
|
|
v-else
|
|
|
|
:href="`/movie/${movie.id}/${movie.slug}`"
|
|
|
|
:title="movie.title"
|
|
|
|
class="tile-info title nolink"
|
|
|
|
>{{ movie.title }}</a>
|
2024-03-25 01:08:09 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref, inject } from 'vue';
|
|
|
|
import { format } from 'date-fns';
|
|
|
|
|
2024-06-01 22:30:56 +00:00
|
|
|
import getPath from '#/src/get-path.js';
|
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
import Heart from '#/components/stashes/heart.vue';
|
2024-03-25 01:08:09 +00:00
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
movie: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
2024-06-02 03:22:08 +00:00
|
|
|
showDetails: {
|
2024-05-31 01:48:17 +00:00
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2024-03-25 01:08:09 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const pageContext = inject('pageContext');
|
|
|
|
const user = pageContext.user;
|
|
|
|
const pageStash = pageContext.pageProps.stash;
|
2024-03-27 02:15:37 +00:00
|
|
|
const currentStash = pageStash || user?.primaryStash;
|
2024-03-25 01:08:09 +00:00
|
|
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
2024-05-31 01:48:17 +00:00
|
|
|
const favorited = ref(props.movie.stashes?.some((movieStash) => movieStash.id === currentStash.id));
|
2024-03-25 01:08:09 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.movie-tile {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak-30);
|
|
|
|
border-radius: .25rem;
|
|
|
|
overflow: hidden;
|
|
|
|
background: var(--background-base);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak-20);
|
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
:deep(.bookmarks) .icon:not(.favorited):not(:hover) {
|
2024-03-25 01:08:09 +00:00
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.unstashed {
|
|
|
|
opacity: .5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.cover-container {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-grow: 1;
|
|
|
|
position: relative;
|
|
|
|
background: var(--shadow-weak-30);
|
2024-05-31 01:48:17 +00:00
|
|
|
aspect-ratio: 2/3;
|
|
|
|
overflow: hidden;
|
2024-03-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.cover-link {
|
2024-05-31 01:48:17 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2024-03-25 01:08:09 +00:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.thumbnail {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
object-fit: cover;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nocover {
|
|
|
|
width: 25%;
|
|
|
|
opacity: .1;
|
|
|
|
}
|
|
|
|
|
2024-06-10 01:24:48 +00:00
|
|
|
.dark .nocover {
|
|
|
|
filter: invert();
|
|
|
|
}
|
|
|
|
|
2024-03-25 01:08:09 +00:00
|
|
|
.tile-info {
|
|
|
|
flex-shrink: 0;
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tile-meta {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
padding: .4rem .5rem;
|
|
|
|
border-radius: 0 0 .25rem .25rem;
|
|
|
|
margin-bottom: .5rem;
|
|
|
|
background: var(--shadow-strong-30);
|
|
|
|
color: var(--text-light);
|
|
|
|
font-size: .8rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.channel {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
margin-right: .5rem;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.channel-link {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.favicon-link {
|
|
|
|
display: inline-flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.favicon {
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
|
|
|
margin-right: .5rem;
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
|
|
|
|
.date {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nodate {
|
|
|
|
color: var(--highlight-strong-10);
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 0 .5rem;
|
2024-05-31 01:48:17 +00:00
|
|
|
margin-bottom: .3rem;
|
|
|
|
font-size: .9rem;
|
|
|
|
|
|
|
|
&.tile-info {
|
|
|
|
padding: .5rem;
|
|
|
|
margin: 0;
|
|
|
|
}
|
2024-03-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.actors {
|
|
|
|
height: 2.4rem;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
overflow: hidden;
|
|
|
|
font-size: .9rem;
|
|
|
|
padding: 0 .5rem;
|
2024-05-31 01:48:17 +00:00
|
|
|
margin-bottom: .3rem;
|
2024-03-25 01:08:09 +00:00
|
|
|
line-height: 1.35;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actor-item:not(:last-child):after {
|
|
|
|
content: ',\00a0';
|
|
|
|
}
|
|
|
|
|
|
|
|
.actor {
|
|
|
|
&:hover {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tags {
|
|
|
|
height: 1rem;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: .5rem;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 0 .5rem;
|
|
|
|
margin-bottom: .25rem;
|
2024-06-10 01:24:48 +00:00
|
|
|
color: var(--glass-strong-10);
|
2024-03-25 01:08:09 +00:00
|
|
|
font-size: .75rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.icon.heart {
|
|
|
|
width: 2rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
padding: .5rem .5rem 1rem 1rem;
|
|
|
|
fill: var(--highlight-strong-10);
|
|
|
|
filter: drop-shadow(0 0 3px var(--shadow));
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
fill: var(--primary);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.favorited {
|
|
|
|
fill: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|