2020-08-01 13:11:07 +00:00
|
|
|
<template>
|
|
|
|
<div class="tile">
|
2021-01-25 22:01:07 +00:00
|
|
|
<Details :release="movie" />
|
|
|
|
|
2020-08-08 16:10:59 +00:00
|
|
|
<div class="movie">
|
2021-09-11 22:05:45 +00:00
|
|
|
<RouterLink
|
2020-09-08 00:20:15 +00:00
|
|
|
:to="{ name: 'movie', params: { releaseId: movie.id, releaseSlug: movie.slug } }"
|
2020-08-08 16:10:59 +00:00
|
|
|
class="cover"
|
2020-08-02 01:44:14 +00:00
|
|
|
>
|
2020-08-08 16:10:59 +00:00
|
|
|
<img
|
|
|
|
v-if="movie.covers[0]"
|
2021-02-22 01:33:39 +00:00
|
|
|
:src="getPath(movie.covers[0], 'thumbnail')"
|
|
|
|
:style="{ 'background-image': getBgPath(movie.covers[0], 'lazy') }"
|
2020-12-27 22:10:11 +00:00
|
|
|
loading="lazy"
|
2020-08-08 16:10:59 +00:00
|
|
|
>
|
2021-09-11 22:05:45 +00:00
|
|
|
|
2022-02-08 23:19:54 +00:00
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
:title="movie.title"
|
|
|
|
class="unavailable"
|
|
|
|
><Icon icon="blocked" /></div>
|
|
|
|
|
2021-09-11 22:05:45 +00:00
|
|
|
<Icon
|
2021-09-12 21:21:39 +00:00
|
|
|
v-show="(!stash || stash.primary) && favorited"
|
2021-09-11 22:05:45 +00:00
|
|
|
icon="heart7"
|
|
|
|
class="stash stashed"
|
|
|
|
@click.prevent.native="unstashMovie"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Icon
|
2021-09-12 21:21:39 +00:00
|
|
|
v-show="(!stash || stash.primary) && favorited === false"
|
2021-09-11 22:05:45 +00:00
|
|
|
icon="heart8"
|
|
|
|
class="stash unstashed"
|
|
|
|
@click.prevent.native="stashMovie"
|
|
|
|
/>
|
2021-09-12 21:21:39 +00:00
|
|
|
|
|
|
|
<Icon
|
|
|
|
v-show="stash && !stash.primary"
|
|
|
|
icon="cross2"
|
|
|
|
class="stash unstash"
|
|
|
|
@click.prevent.native="unstashMovie"
|
|
|
|
/>
|
2021-09-11 22:05:45 +00:00
|
|
|
</RouterLink>
|
2020-08-02 01:44:14 +00:00
|
|
|
|
2020-08-08 16:10:59 +00:00
|
|
|
<div class="info">
|
2021-09-11 22:05:45 +00:00
|
|
|
<RouterLink
|
2020-09-08 00:20:15 +00:00
|
|
|
:to="{ name: 'movie', params: { releaseId: movie.id, releaseSlug: movie.slug } }"
|
2020-08-08 16:10:59 +00:00
|
|
|
class="title-link"
|
|
|
|
>
|
|
|
|
<h3 class="title">{{ movie.title }}</h3>
|
2021-09-11 22:05:45 +00:00
|
|
|
</RouterLink>
|
2020-08-10 19:39:55 +00:00
|
|
|
|
|
|
|
<ul
|
|
|
|
class="actors nolist"
|
|
|
|
:title="movie.actors.map(actor => actor.name).join(', ')"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="actor in movie.actors"
|
|
|
|
:key="`tag-${movie.id}-${actor.id}`"
|
|
|
|
class="actor"
|
2021-09-11 22:05:45 +00:00
|
|
|
><RouterLink
|
2020-08-10 19:39:55 +00:00
|
|
|
:to="`/actor/${actor.id}/${actor.slug}`"
|
|
|
|
class="actor-link"
|
2021-09-11 22:05:45 +00:00
|
|
|
>{{ actor.name }}</RouterLink></li>
|
2020-08-10 19:39:55 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<ul
|
|
|
|
class="tags nolist"
|
|
|
|
:title="movie.tags.map(tag => tag.name).join(', ')"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="tag in movie.tags"
|
|
|
|
:key="`tag-${movie.id}-${tag.id}`"
|
|
|
|
class="tag"
|
2021-09-11 22:05:45 +00:00
|
|
|
><RouterLink
|
2020-08-10 19:39:55 +00:00
|
|
|
:to="`/tag/${tag.slug}`"
|
|
|
|
class="tag-link"
|
2021-09-11 22:05:45 +00:00
|
|
|
>{{ tag.name }}</RouterLink></li>
|
2020-08-10 19:39:55 +00:00
|
|
|
</ul>
|
2020-08-08 16:10:59 +00:00
|
|
|
</div>
|
2020-08-02 01:44:14 +00:00
|
|
|
</div>
|
2020-08-01 13:11:07 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-08-12 01:30:20 +00:00
|
|
|
import Details from './tile-details.vue';
|
|
|
|
|
2021-09-11 22:05:45 +00:00
|
|
|
async function stashMovie() {
|
|
|
|
this.favorited = true;
|
|
|
|
|
|
|
|
try {
|
|
|
|
await this.$store.dispatch('stashMovie', {
|
|
|
|
movieId: this.movie.id,
|
|
|
|
stashId: this.$store.getters.favorites.id,
|
|
|
|
});
|
|
|
|
|
|
|
|
this.$emit('stash', true);
|
|
|
|
} catch (error) {
|
|
|
|
this.favorited = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function unstashMovie() {
|
2021-09-12 21:21:39 +00:00
|
|
|
if (!this.stash || this.stash.primary) {
|
|
|
|
this.favorited = false;
|
|
|
|
}
|
2021-09-11 22:05:45 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
await this.$store.dispatch('unstashMovie', {
|
|
|
|
movieId: this.movie.id,
|
2021-09-12 21:21:39 +00:00
|
|
|
stashId: this.stash?.id || this.$store.getters.favorites.id,
|
2021-09-11 22:05:45 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
this.$emit('stash', false);
|
|
|
|
} catch (error) {
|
|
|
|
this.favorited = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-27 22:10:11 +00:00
|
|
|
function sfw() {
|
|
|
|
return this.$store.state.ui.sfw;
|
|
|
|
}
|
|
|
|
|
2020-08-01 13:11:07 +00:00
|
|
|
export default {
|
2020-08-12 01:30:20 +00:00
|
|
|
components: {
|
|
|
|
Details,
|
|
|
|
},
|
2020-08-01 13:11:07 +00:00
|
|
|
props: {
|
|
|
|
movie: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
2021-09-12 21:21:39 +00:00
|
|
|
stash: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
2020-08-01 13:11:07 +00:00
|
|
|
},
|
2021-09-11 22:05:45 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
favorited: this.movie.isFavorited,
|
|
|
|
};
|
|
|
|
},
|
2020-12-27 22:10:11 +00:00
|
|
|
computed: {
|
|
|
|
sfw,
|
|
|
|
},
|
2021-09-11 22:05:45 +00:00
|
|
|
methods: {
|
|
|
|
stashMovie,
|
|
|
|
unstashMovie,
|
|
|
|
},
|
2020-08-01 13:11:07 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-08-12 01:30:20 +00:00
|
|
|
@import 'breakpoints';
|
|
|
|
|
2020-08-01 13:11:07 +00:00
|
|
|
.tile {
|
2020-08-02 01:44:14 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-08-01 13:11:07 +00:00
|
|
|
background: var(--background);
|
2020-08-10 19:39:55 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
2020-08-02 01:44:14 +00:00
|
|
|
font-size: 0;
|
2021-09-11 22:05:45 +00:00
|
|
|
|
2021-09-12 21:21:39 +00:00
|
|
|
&:hover .unstashed,
|
|
|
|
&:hover .unstash {
|
2021-09-11 22:05:45 +00:00
|
|
|
fill: var(--lighten);
|
|
|
|
}
|
2020-08-01 13:11:07 +00:00
|
|
|
}
|
|
|
|
|
2020-08-08 16:10:59 +00:00
|
|
|
.movie {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title-link {
|
|
|
|
color: var(--text);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
2020-08-02 01:44:14 +00:00
|
|
|
.cover {
|
2022-02-08 23:19:54 +00:00
|
|
|
height: 16rem;
|
|
|
|
width: 11.25rem;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-shrink: 0;
|
2021-09-11 22:05:45 +00:00
|
|
|
position: relative;
|
2020-08-10 19:39:55 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
2022-02-08 23:19:54 +00:00
|
|
|
background-color: var(--shadow-hint);
|
2020-08-08 16:10:59 +00:00
|
|
|
|
2020-08-02 01:44:14 +00:00
|
|
|
img {
|
2020-08-10 19:39:55 +00:00
|
|
|
height: 100%;
|
2022-02-08 23:19:54 +00:00
|
|
|
width: 100%;
|
2020-12-27 22:10:11 +00:00
|
|
|
background-position: center;
|
|
|
|
background-size: cover;
|
2020-08-10 19:39:55 +00:00
|
|
|
object-fit: cover;
|
2020-12-27 22:10:11 +00:00
|
|
|
object-position: center;
|
2020-08-02 01:44:14 +00:00
|
|
|
}
|
2022-02-08 23:19:54 +00:00
|
|
|
|
|
|
|
.unavailable .icon {
|
|
|
|
width: 2rem;
|
|
|
|
height: 2rem;
|
|
|
|
fill: var(--shadow-hint);
|
|
|
|
}
|
2020-08-02 01:44:14 +00:00
|
|
|
}
|
|
|
|
|
2020-08-10 19:39:55 +00:00
|
|
|
.info {
|
2021-02-10 02:00:17 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-08-10 19:39:55 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
2020-08-01 13:11:07 +00:00
|
|
|
.title {
|
2020-08-10 19:39:55 +00:00
|
|
|
box-sizing: border-box;
|
2020-08-01 13:11:07 +00:00
|
|
|
padding: 1rem;
|
|
|
|
margin: 0;
|
|
|
|
font-size: 1rem;
|
2020-08-10 19:39:55 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actors {
|
2021-02-10 02:00:17 +00:00
|
|
|
height: 0;
|
|
|
|
flex-grow: 1;
|
2020-08-10 19:39:55 +00:00
|
|
|
padding: 0 1rem;
|
|
|
|
line-height: 1.5;
|
2021-02-10 02:00:17 +00:00
|
|
|
overflow: hidden;
|
2020-08-10 19:39:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.actor:not(:last-child)::after {
|
|
|
|
content: ',';
|
|
|
|
margin: 0 .25rem 0 0;
|
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actor-link {
|
|
|
|
font-size: 1rem;
|
|
|
|
color: var(--link);
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tags {
|
2021-02-10 02:00:17 +00:00
|
|
|
padding: .25rem 1rem;
|
2020-08-10 19:39:55 +00:00
|
|
|
height: 1.75rem;
|
|
|
|
line-height: 2;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
margin: 0 0 .5rem 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tag-link {
|
|
|
|
background: var(--background);
|
|
|
|
font-size: .75rem;
|
|
|
|
padding: .25rem .5rem;
|
|
|
|
color: var(--shadow);
|
|
|
|
font-weight: bold;
|
|
|
|
text-decoration: none;
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
2020-08-01 13:11:07 +00:00
|
|
|
}
|
2020-08-12 01:30:20 +00:00
|
|
|
|
2021-09-11 22:05:45 +00:00
|
|
|
.stash {
|
2021-11-20 23:15:19 +00:00
|
|
|
width: 1.5rem;
|
|
|
|
height: 1.5rem;
|
2022-02-08 23:19:54 +00:00
|
|
|
padding: .25rem .5rem .5rem .5rem;
|
2021-09-11 22:05:45 +00:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
2022-02-08 23:19:54 +00:00
|
|
|
left: 0;
|
2021-09-11 22:05:45 +00:00
|
|
|
fill: var(--lighten-weak);
|
|
|
|
filter: drop-shadow(0 0 2px var(--darken));
|
|
|
|
|
2021-09-11 22:24:36 +00:00
|
|
|
&:hover.unstashed,
|
2021-09-11 22:05:45 +00:00
|
|
|
&.stashed {
|
|
|
|
fill: var(--primary);
|
|
|
|
}
|
2021-09-12 21:21:39 +00:00
|
|
|
|
|
|
|
&:hover.unstash {
|
|
|
|
fill: var(--text-light);
|
|
|
|
filter: drop-shadow(0 0 2px var(--darken-weak));
|
|
|
|
}
|
2021-09-11 22:05:45 +00:00
|
|
|
}
|
|
|
|
|
2021-08-21 22:40:22 +00:00
|
|
|
@media(max-width: $breakpoint-kilo) {
|
2022-02-08 23:19:54 +00:00
|
|
|
.cover {
|
2020-08-12 01:30:20 +00:00
|
|
|
height: 12rem;
|
2022-02-08 23:19:54 +00:00
|
|
|
width: 8.25rem;
|
2020-08-12 01:30:20 +00:00
|
|
|
}
|
2021-02-10 02:00:17 +00:00
|
|
|
|
|
|
|
/* ensure no half actor names show */
|
|
|
|
.actors {
|
|
|
|
margin: 0 0 1rem 0;
|
|
|
|
}
|
2020-08-12 01:30:20 +00:00
|
|
|
}
|
2020-08-01 13:11:07 +00:00
|
|
|
</style>
|