2020-06-28 01:28:11 +00:00
|
|
|
<template>
|
2020-07-18 03:12:32 +00:00
|
|
|
<div
|
|
|
|
v-if="tag.poster"
|
2020-06-28 01:28:11 +00:00
|
|
|
class="tile"
|
|
|
|
>
|
2020-07-18 03:12:32 +00:00
|
|
|
<router-link
|
2020-09-09 19:36:52 +00:00
|
|
|
:to="`/tag/${tag.slug}`"
|
2020-07-18 03:12:32 +00:00
|
|
|
:title="tag.name"
|
|
|
|
class="poster-link"
|
|
|
|
>
|
2020-06-28 01:28:11 +00:00
|
|
|
<img
|
|
|
|
v-if="!lazy && !sfw"
|
|
|
|
:src="`/img/${tag.poster.thumbnail}`"
|
2020-12-26 22:51:27 +00:00
|
|
|
:style="{ 'background-image': `url(/img/${tag.poster.lazy})` }"
|
2021-03-07 18:47:06 +00:00
|
|
|
:title="comment"
|
2020-06-28 01:28:11 +00:00
|
|
|
:alt="tag.name"
|
|
|
|
class="poster"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-if="!lazy && sfw"
|
|
|
|
:src="`/img/${tag.poster.sfw.thumbnail}`"
|
2020-12-26 22:51:27 +00:00
|
|
|
:style="{ 'background-image': `url(/img/${tag.poster.sfw.lazy})` }"
|
2020-06-28 01:28:11 +00:00
|
|
|
:title="tag.poster.sfw.comment"
|
|
|
|
:alt="tag.name"
|
|
|
|
class="poster"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-if="lazy && !sfw"
|
2020-12-26 22:51:27 +00:00
|
|
|
:src="`/img/${tag.poster.thumbnail}`"
|
|
|
|
:style="{ 'background-image': `url(/img/${tag.poster.lazy})` }"
|
2021-03-07 18:47:06 +00:00
|
|
|
:title="comment"
|
2020-06-28 01:28:11 +00:00
|
|
|
:alt="tag.name"
|
2020-12-26 22:51:27 +00:00
|
|
|
loading="lazy"
|
2020-06-28 01:28:11 +00:00
|
|
|
class="poster"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-if="lazy && sfw"
|
2020-12-26 22:51:27 +00:00
|
|
|
:src="`/img/${tag.poster.sfw.thumbnail}`"
|
|
|
|
:style="{ 'background-image': `url(/img/${tag.poster.sfw.lazy})` }"
|
2020-06-28 01:28:11 +00:00
|
|
|
:title="tag.poster.sfw.comment"
|
|
|
|
:alt="tag.name"
|
2020-12-26 22:51:27 +00:00
|
|
|
loading="lazy"
|
2020-06-28 01:28:11 +00:00
|
|
|
class="poster"
|
|
|
|
>
|
2021-03-07 03:05:25 +00:00
|
|
|
|
|
|
|
<Logo
|
2021-03-07 19:00:57 +00:00
|
|
|
v-if="!sfw"
|
2021-03-07 03:05:25 +00:00
|
|
|
:photo="tag.poster"
|
|
|
|
favicon
|
|
|
|
/>
|
2020-07-18 03:12:32 +00:00
|
|
|
</router-link>
|
2020-08-01 13:11:07 +00:00
|
|
|
|
|
|
|
<router-link
|
|
|
|
class="title"
|
2020-09-09 19:36:52 +00:00
|
|
|
:to="`/tag/${tag.slug}`"
|
2020-08-01 13:11:07 +00:00
|
|
|
:title="tag.name"
|
|
|
|
>{{ tag.name }}</router-link>
|
2020-07-18 03:12:32 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="title"
|
|
|
|
>{{ tag.name }}</span>
|
2020-06-28 01:28:11 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-07 03:05:25 +00:00
|
|
|
import Logo from '../album/logo.vue';
|
|
|
|
|
2020-06-28 01:28:11 +00:00
|
|
|
function sfw() {
|
|
|
|
return this.$store.state.ui.sfw;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2021-03-07 03:05:25 +00:00
|
|
|
components: {
|
|
|
|
Logo,
|
|
|
|
},
|
2020-06-28 01:28:11 +00:00
|
|
|
props: {
|
|
|
|
tag: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
lazy: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
2021-03-07 18:47:06 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2021-03-09 23:20:50 +00:00
|
|
|
comment: this.tag.poster?.entity ? `${this.tag.poster.comment} for ${this.tag.poster.entity.name}` : this.tag.poster?.comment,
|
2021-03-07 18:47:06 +00:00
|
|
|
};
|
|
|
|
},
|
2020-06-28 01:28:11 +00:00
|
|
|
computed: {
|
|
|
|
sfw,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.tile {
|
|
|
|
box-sizing: border-box;
|
|
|
|
position: relative;
|
2020-06-28 20:29:18 +00:00
|
|
|
text-decoration: none;
|
2020-08-01 13:11:07 +00:00
|
|
|
font-size: 0;
|
2020-07-19 17:40:21 +00:00
|
|
|
|
2020-09-17 02:01:40 +00:00
|
|
|
&:hover {
|
|
|
|
.poster {
|
2021-03-07 03:05:25 +00:00
|
|
|
box-shadow: 0 0 2px var(--darken);
|
2020-09-17 02:01:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2021-03-07 03:05:25 +00:00
|
|
|
color: var(--primary);
|
2020-09-17 02:01:40 +00:00
|
|
|
}
|
2020-07-19 17:40:21 +00:00
|
|
|
}
|
2020-06-28 01:28:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.poster {
|
2020-12-26 22:51:27 +00:00
|
|
|
display: inline-block;
|
2020-06-28 01:28:11 +00:00
|
|
|
width: 100%;
|
2020-12-26 22:51:27 +00:00
|
|
|
height: 13.5rem;
|
|
|
|
object-fit: cover;
|
|
|
|
background-size: cover;
|
2021-03-07 15:39:54 +00:00
|
|
|
background-position: center;
|
2020-07-18 03:12:32 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
2020-06-28 01:28:11 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 03:05:25 +00:00
|
|
|
.poster-link {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2020-06-28 01:28:11 +00:00
|
|
|
.title {
|
2020-08-01 13:11:07 +00:00
|
|
|
display: block;
|
2020-06-28 01:28:11 +00:00
|
|
|
box-sizing: border-box;
|
2021-03-07 03:05:25 +00:00
|
|
|
padding: .5rem;
|
2020-06-28 01:28:11 +00:00
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
2021-03-07 03:05:25 +00:00
|
|
|
color: var(--shadow-strong);
|
2020-07-18 03:12:32 +00:00
|
|
|
text-decoration: none;
|
2020-08-01 13:11:07 +00:00
|
|
|
font-size: .9rem;
|
2020-06-28 01:28:11 +00:00
|
|
|
font-weight: bold;
|
|
|
|
text-transform: capitalize;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
</style>
|