Added SFW mode with NSFW warning to releases.
This commit is contained in:
parent
ad7874649f
commit
baaa701249
|
@ -7,7 +7,7 @@
|
||||||
<video
|
<video
|
||||||
v-if="release.trailer"
|
v-if="release.trailer"
|
||||||
:src="`/media/${release.trailer.path}`"
|
:src="`/media/${release.trailer.path}`"
|
||||||
:poster="`/media/${(release.poster && release.poster.thumbnail)}`"
|
:poster="release.poster && (sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`)"
|
||||||
:alt="release.title"
|
:alt="release.title"
|
||||||
class="item trailer-video"
|
class="item trailer-video"
|
||||||
controls
|
controls
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<video
|
<video
|
||||||
v-else-if="release.teaser && /^video\//.test(release.teaser.mime)"
|
v-else-if="release.teaser && /^video\//.test(release.teaser.mime)"
|
||||||
:src="`/media/${release.teaser.path}`"
|
:src="`/media/${release.teaser.path}`"
|
||||||
:poster="`/media/${(release.poster && release.poster.thumbnail)}`"
|
:poster="release.poster && (sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`)"
|
||||||
:alt="release.title"
|
:alt="release.title"
|
||||||
class="item trailer-video"
|
class="item trailer-video"
|
||||||
controls
|
controls
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<img
|
<img
|
||||||
v-else-if="release.teaser && /^image\//.test(release.teaser.mime)"
|
v-else-if="release.teaser && /^image\//.test(release.teaser.mime)"
|
||||||
:src="`/media/${release.teaser.path}`"
|
:src="sfw ? `/img/${release.teaser.sfw.thumbnail}` : `/media/${release.teaser.path}`"
|
||||||
:alt="release.title"
|
:alt="release.title"
|
||||||
class="item trailer-video"
|
class="item trailer-video"
|
||||||
>
|
>
|
||||||
|
@ -41,6 +41,13 @@
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="poster-link"
|
class="poster-link"
|
||||||
><Icon icon="image" /></a>
|
><Icon icon="image" /></a>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="sfw && !playing"
|
||||||
|
class="warning"
|
||||||
|
>
|
||||||
|
<Icon icon="warning2" />NSFW
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="release.covers && release.covers.length > 0">
|
<template v-if="release.covers && release.covers.length > 0">
|
||||||
|
@ -62,19 +69,32 @@
|
||||||
v-for="photo in photos"
|
v-for="photo in photos"
|
||||||
:key="`banner-${photo.index}`"
|
:key="`banner-${photo.index}`"
|
||||||
:href="`/media/${photo.path}`"
|
:href="`/media/${photo.path}`"
|
||||||
|
:class="{ sfw }"
|
||||||
|
class="item-link"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
:src="`/media/${photo.thumbnail}`"
|
:src="sfw ? `/img/${photo.sfw.thumbnail}` : `/media/${photo.thumbnail}`"
|
||||||
:alt="`Photo ${photo.index + 1}`"
|
:alt="`Photo ${photo.index + 1}`"
|
||||||
class="item"
|
class="item"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="sfw"
|
||||||
|
class="warning"
|
||||||
|
>
|
||||||
|
<Icon icon="warning2" />NSFW
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
function sfw() {
|
||||||
|
return this.$store.state.ui.sfw;
|
||||||
|
}
|
||||||
|
|
||||||
function photos() {
|
function photos() {
|
||||||
if (this.release.trailer || this.release.teaser) {
|
if (this.release.trailer || this.release.teaser) {
|
||||||
// poster will be on trailer video
|
// poster will be on trailer video
|
||||||
|
@ -106,6 +126,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
photos,
|
photos,
|
||||||
|
sfw,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scrollBanner,
|
scrollBanner,
|
||||||
|
@ -130,17 +151,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.trailer {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
max-width: 100vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trailer-video {
|
|
||||||
max-width: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster-link {
|
.poster-link {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .5rem;
|
top: .5rem;
|
||||||
|
@ -150,7 +160,8 @@ export default {
|
||||||
.icon {
|
.icon {
|
||||||
width: 1.5rem;
|
width: 1.5rem;
|
||||||
height: 1.5rem;
|
height: 1.5rem;
|
||||||
fill: var(--lighten);
|
fill: var(--lighten-strong);
|
||||||
|
filter: drop-shadow(0 0 1px var(--darken-weak));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.playing {
|
&.playing {
|
||||||
|
@ -162,16 +173,74 @@ export default {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
fill: var(--lighten-strong);
|
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;
|
||||||
|
text-shadow: 0 0 3px var(--shadow-strong);
|
||||||
|
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;
|
||||||
|
animation: alert .5s ease infinite .1s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .warning {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
height: 18rem;
|
height: 18rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.trailer {
|
||||||
|
max-width: 100vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trailer-video {
|
||||||
|
max-width: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes alert {
|
||||||
|
0% {
|
||||||
|
color: var(--text-light);
|
||||||
|
fill: var(--text-light);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
color: var(--alert);
|
||||||
|
fill: var(--alert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media(max-width: $breakpoint2) {
|
@media(max-width: $breakpoint2) {
|
||||||
.trailer-video {
|
.trailer-video {
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="release.poster"
|
v-if="release.poster"
|
||||||
:src="`/${release.batch === 'dummy' ? 'img' : 'media'}/${release.poster.thumbnail}`"
|
:src="sfw ? `/img/${release.poster.sfw.thumbnail}` : `/media/${release.poster.thumbnail}`"
|
||||||
:alt="release.title"
|
:alt="release.title"
|
||||||
class="thumbnail"
|
class="thumbnail"
|
||||||
>
|
>
|
||||||
|
@ -87,13 +87,6 @@
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<img
|
|
||||||
v-else-if="release.covers && release.covers.length > 0"
|
|
||||||
:src="`/${release.batch === 'dummy' ? 'img' : 'media'}/${release.covers[0].thumbnail}`"
|
|
||||||
:alt="release.title"
|
|
||||||
class="thumbnail"
|
|
||||||
>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
:title="release.title"
|
:title="release.title"
|
||||||
|
@ -156,6 +149,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
function sfw() {
|
||||||
|
return this.$store.state.ui.sfw;
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
release: {
|
release: {
|
||||||
|
@ -176,6 +173,9 @@ export default {
|
||||||
isUpcoming: this.isAfter(this.release.date, new Date()),
|
isUpcoming: this.isAfter(this.release.date, new Date()),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
sfw,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,9 @@ $female: #f0a;
|
||||||
|
|
||||||
--logo-shadow: drop-shadow(1px 0 0 $shadow-weak) drop-shadow(-1px 0 0 $shadow-weak) drop-shadow(0 1px 0 $shadow-weak) drop-shadow(0 -1px 0 $shadow-weak);
|
--logo-shadow: drop-shadow(1px 0 0 $shadow-weak) drop-shadow(-1px 0 0 $shadow-weak) drop-shadow(0 1px 0 $shadow-weak) drop-shadow(0 -1px 0 $shadow-weak);
|
||||||
--logo-highlight: drop-shadow(0 0 1px $highlight);
|
--logo-highlight: drop-shadow(0 0 1px $highlight);
|
||||||
|
|
||||||
|
--alert: #f00;
|
||||||
|
--warn: #fa0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.light {
|
.light {
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<title>warning</title>
|
||||||
|
<path d="M8 1.45l6.705 13.363h-13.409l6.705-13.363zM8 0c-0.345 0-0.69 0.233-0.951 0.698l-6.829 13.611c-0.523 0.93-0.078 1.691 0.989 1.691h13.583c1.067 0 1.512-0.761 0.989-1.691h0l-6.829-13.611c-0.262-0.465-0.606-0.698-0.951-0.698v0z"></path>
|
||||||
|
<path d="M9 13c0 0.552-0.448 1-1 1s-1-0.448-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1z"></path>
|
||||||
|
<path d="M8 11c-0.552 0-1-0.448-1-1v-3c0-0.552 0.448-1 1-1s1 0.448 1 1v3c0 0.552-0.448 1-1 1z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 596 B |
|
@ -0,0 +1,5 @@
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<title>warning2</title>
|
||||||
|
<path d="M15.781 14.309v0l-6.829-13.611c-0.262-0.465-0.606-0.698-0.951-0.698s-0.69 0.233-0.951 0.698l-6.829 13.611c-0.523 0.93-0.078 1.691 0.989 1.691h13.583c1.067 0 1.512-0.761 0.989-1.691zM8 14c-0.552 0-1-0.448-1-1s0.448-1 1-1c0.552 0 1 0.448 1 1s-0.448 1-1 1zM9 10c0 0.552-0.448 1-1 1s-1-0.448-1-1v-3c0-0.552 0.448-1 1-1s1 0.448 1 1v3z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 510 B |
|
@ -80,6 +80,12 @@ const releasePosterFragment = `
|
||||||
path
|
path
|
||||||
thumbnail
|
thumbnail
|
||||||
comment
|
comment
|
||||||
|
sfw: sfwMedia {
|
||||||
|
id
|
||||||
|
thumbnail
|
||||||
|
path
|
||||||
|
comment
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@ -91,6 +97,12 @@ const releaseCoversFragment = `
|
||||||
path
|
path
|
||||||
thumbnail
|
thumbnail
|
||||||
comment
|
comment
|
||||||
|
sfw: sfwMedia {
|
||||||
|
id
|
||||||
|
thumbnail
|
||||||
|
path
|
||||||
|
comment
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@ -102,6 +114,12 @@ const releasePhotosFragment = `
|
||||||
path
|
path
|
||||||
thumbnail
|
thumbnail
|
||||||
comment
|
comment
|
||||||
|
sfw: sfwMedia {
|
||||||
|
id
|
||||||
|
thumbnail
|
||||||
|
path
|
||||||
|
comment
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in New Issue