2019-12-13 04:04:04 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
class="banner"
|
|
|
|
@wheel.prevent="scrollBanner"
|
|
|
|
>
|
|
|
|
<div class="trailer">
|
|
|
|
<video
|
|
|
|
v-if="release.trailer"
|
|
|
|
:src="`/media/${release.trailer.path}`"
|
2020-04-02 00:02:03 +00:00
|
|
|
:poster="release.poster && (sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`)"
|
2019-12-13 04:04:04 +00:00
|
|
|
:alt="release.title"
|
2020-04-02 00:23:54 +00:00
|
|
|
:class="{ sfw: sfw && paused }"
|
2019-12-13 04:04:04 +00:00
|
|
|
class="item trailer-video"
|
|
|
|
controls
|
2020-04-02 00:23:54 +00:00
|
|
|
@playing="playing = true; paused = false;"
|
|
|
|
@pause="playing = false; paused = true;"
|
2019-12-13 04:04:04 +00:00
|
|
|
>Sorry, the tailer cannot be played in your browser</video>
|
2020-02-02 04:14:58 +00:00
|
|
|
|
|
|
|
<video
|
|
|
|
v-else-if="release.teaser && /^video\//.test(release.teaser.mime)"
|
|
|
|
:src="`/media/${release.teaser.path}`"
|
2020-04-02 00:02:03 +00:00
|
|
|
:poster="release.poster && (sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`)"
|
2020-02-02 04:14:58 +00:00
|
|
|
:alt="release.title"
|
2020-04-02 00:23:54 +00:00
|
|
|
:class="{ sfw: sfw && paused }"
|
2020-02-02 04:14:58 +00:00
|
|
|
class="item trailer-video"
|
|
|
|
controls
|
2020-04-02 00:23:54 +00:00
|
|
|
@playing="playing = true; paused = false;"
|
|
|
|
@pause="playing = false; paused = true;"
|
2020-02-02 04:14:58 +00:00
|
|
|
>Sorry, the tailer cannot be played in your browser</video>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-else-if="release.teaser && /^image\//.test(release.teaser.mime)"
|
2020-04-02 00:02:03 +00:00
|
|
|
:src="sfw ? `/img/${release.teaser.sfw.thumbnail}` : `/media/${release.teaser.path}`"
|
2020-02-02 04:14:58 +00:00
|
|
|
:alt="release.title"
|
|
|
|
class="item trailer-video"
|
|
|
|
>
|
2020-03-01 04:28:08 +00:00
|
|
|
|
|
|
|
<a
|
|
|
|
v-if="release.poster"
|
|
|
|
:href="`/media/${release.poster.path}`"
|
|
|
|
:class="{ playing }"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="poster-link"
|
|
|
|
><Icon icon="image" /></a>
|
2020-04-02 00:02:03 +00:00
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="sfw && !playing"
|
|
|
|
class="warning"
|
|
|
|
>
|
|
|
|
<Icon icon="warning2" />NSFW
|
|
|
|
</span>
|
2019-12-13 04:04:04 +00:00
|
|
|
</div>
|
|
|
|
|
2020-03-09 01:02:29 +00:00
|
|
|
<template v-if="release.covers && release.covers.length > 0">
|
|
|
|
<a
|
|
|
|
v-for="cover in release.covers"
|
|
|
|
:key="`cover-${cover.id}`"
|
|
|
|
:href="`/media/${cover.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="`/media/${cover.thumbnail}`"
|
|
|
|
class="item cover"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
2019-12-13 04:04:04 +00:00
|
|
|
<a
|
|
|
|
v-for="photo in photos"
|
|
|
|
:key="`banner-${photo.index}`"
|
|
|
|
:href="`/media/${photo.path}`"
|
2020-04-02 00:02:03 +00:00
|
|
|
:class="{ sfw }"
|
|
|
|
class="item-link"
|
2019-12-13 04:04:04 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<img
|
2020-04-02 00:02:03 +00:00
|
|
|
:src="sfw ? `/img/${photo.sfw.thumbnail}` : `/media/${photo.thumbnail}`"
|
2019-12-13 04:04:04 +00:00
|
|
|
:alt="`Photo ${photo.index + 1}`"
|
|
|
|
class="item"
|
|
|
|
>
|
2020-04-02 00:02:03 +00:00
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="sfw"
|
|
|
|
class="warning"
|
|
|
|
>
|
|
|
|
<Icon icon="warning2" />NSFW
|
|
|
|
</span>
|
2019-12-13 04:04:04 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-04-02 00:02:03 +00:00
|
|
|
function sfw() {
|
|
|
|
return this.$store.state.ui.sfw;
|
|
|
|
}
|
|
|
|
|
2019-12-13 04:04:04 +00:00
|
|
|
function photos() {
|
2020-02-12 22:49:22 +00:00
|
|
|
if (this.release.trailer || this.release.teaser) {
|
2019-12-13 15:59:04 +00:00
|
|
|
// poster will be on trailer video
|
|
|
|
return this.release.photos;
|
2019-12-13 04:04:04 +00:00
|
|
|
}
|
|
|
|
|
2019-12-13 15:59:04 +00:00
|
|
|
if (this.release.poster) {
|
|
|
|
return [this.release.poster].concat(this.release.photos);
|
2019-12-13 04:04:04 +00:00
|
|
|
}
|
|
|
|
|
2019-12-13 15:59:04 +00:00
|
|
|
return this.release.photos;
|
2019-12-13 04:04:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function scrollBanner(event) {
|
|
|
|
event.currentTarget.scrollLeft += event.deltaY; // eslint-disable-line no-param-reassign
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
release: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
2020-03-01 04:28:08 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
playing: false,
|
2020-04-02 00:23:54 +00:00
|
|
|
paused: false,
|
2020-03-01 04:28:08 +00:00
|
|
|
};
|
|
|
|
},
|
2019-12-13 04:04:04 +00:00
|
|
|
computed: {
|
|
|
|
photos,
|
2020-04-02 00:02:03 +00:00
|
|
|
sfw,
|
2019-12-13 04:04:04 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
scrollBanner,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.banner {
|
2020-04-01 23:10:50 +00:00
|
|
|
background: var(--empty);
|
2019-12-13 04:04:04 +00:00
|
|
|
flex-shrink: 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow-x: auto;
|
|
|
|
scrollbar-width: none;
|
2020-04-01 23:10:50 +00:00
|
|
|
box-shadow: 0 0 3px var(--shadow);
|
2019-12-13 04:04:04 +00:00
|
|
|
font-size: 0;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-01 04:28:08 +00:00
|
|
|
.poster-link {
|
|
|
|
position: absolute;
|
|
|
|
top: .5rem;
|
|
|
|
right: .5rem;
|
|
|
|
transition: opacity .1s ease;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
width: 1.5rem;
|
|
|
|
height: 1.5rem;
|
2020-04-02 00:02:03 +00:00
|
|
|
fill: var(--lighten-strong);
|
|
|
|
filter: drop-shadow(0 0 1px var(--darken-weak));
|
2020-03-01 04:28:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.playing {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
.icon {
|
2020-04-02 00:02:03 +00:00
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-link,
|
|
|
|
.trailer {
|
|
|
|
position: relative;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.warning {
|
|
|
|
display: none;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: absolute;
|
|
|
|
background: var(--darken-weak);
|
|
|
|
color: var(--text-light);
|
|
|
|
font-size: 1.2rem;
|
|
|
|
font-weight: bold;
|
2020-04-02 02:05:55 +00:00
|
|
|
text-shadow: 0 0 3px var(--darken-strong);
|
2020-04-02 00:02:03 +00:00
|
|
|
pointer-events: none;
|
|
|
|
animation: alert .5s ease infinite .1s;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
display: block;
|
|
|
|
fill: var(--text-light);
|
|
|
|
width: 3rem;
|
|
|
|
height: 3rem;
|
|
|
|
margin: 0 0 .25rem 0;
|
2020-04-02 02:05:55 +00:00
|
|
|
filter: drop-shadow(0 0 3px var(--darken));
|
2020-04-02 00:02:03 +00:00
|
|
|
animation: alert .5s ease infinite .1s;
|
2020-03-01 04:28:08 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-02 00:02:03 +00:00
|
|
|
|
|
|
|
&:hover .warning {
|
|
|
|
display: inline-flex;
|
|
|
|
}
|
2020-03-01 04:28:08 +00:00
|
|
|
}
|
|
|
|
|
2019-12-13 04:04:04 +00:00
|
|
|
.item {
|
|
|
|
height: 18rem;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
2020-02-13 03:11:32 +00:00
|
|
|
|
2020-04-02 00:02:03 +00:00
|
|
|
.trailer {
|
|
|
|
max-width: 100vw;
|
|
|
|
}
|
|
|
|
|
|
|
|
.trailer-video {
|
|
|
|
max-width: 100%;
|
|
|
|
object-fit: cover;
|
2020-04-02 00:23:54 +00:00
|
|
|
|
|
|
|
&.sfw {
|
|
|
|
filter: blur(2rem);
|
|
|
|
}
|
2020-04-02 00:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes alert {
|
|
|
|
0% {
|
|
|
|
color: var(--text-light);
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
50% {
|
|
|
|
color: var(--alert);
|
|
|
|
fill: var(--alert);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-13 03:11:32 +00:00
|
|
|
@media(max-width: $breakpoint2) {
|
|
|
|
.trailer-video {
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
}
|
2019-12-13 04:04:04 +00:00
|
|
|
</style>
|