2020-01-09 00:59:30 +00:00
|
|
|
<template>
|
2020-07-02 23:28:22 +00:00
|
|
|
<div class="photos">
|
|
|
|
<a
|
|
|
|
v-if="tag.poster"
|
|
|
|
:href="`/img/${poster.path}`"
|
|
|
|
:title="poster.comment"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="photo-link"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="`/img/${poster.thumbnail}`"
|
|
|
|
:alt="tag.poster.comment"
|
|
|
|
class="poster"
|
2020-07-22 02:12:20 +00:00
|
|
|
@load="$parent.$emit('load')"
|
2020-07-02 23:28:22 +00:00
|
|
|
>
|
|
|
|
</a>
|
2020-01-09 00:59:30 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
<a
|
|
|
|
v-for="photo in photos"
|
|
|
|
:key="`photo-${photo.id}`"
|
|
|
|
:title="photo.comment"
|
|
|
|
:href="`/img/${photo.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="photo-link"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="`/img/${photo.thumbnail}`"
|
|
|
|
:alt="photo.comment"
|
|
|
|
class="photo"
|
2020-07-22 02:12:20 +00:00
|
|
|
@load="$parent.$emit('load')"
|
2020-07-02 23:28:22 +00:00
|
|
|
>
|
|
|
|
</a>
|
|
|
|
</div>
|
2020-01-09 00:59:30 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-03-23 00:43:49 +00:00
|
|
|
function poster() {
|
2020-07-02 23:28:22 +00:00
|
|
|
if (this.$store.state.ui.sfw) {
|
|
|
|
return this.tag.poster.sfw;
|
|
|
|
}
|
2020-03-23 00:43:49 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
return this.tag.poster;
|
2020-03-23 00:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function photos() {
|
2020-07-02 23:28:22 +00:00
|
|
|
if (this.$store.state.ui.sfw) {
|
|
|
|
return this.tag.photos.map(photo => photo.sfw);
|
|
|
|
}
|
2020-03-23 00:43:49 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
return this.tag.photos;
|
2020-03-23 00:43:49 +00:00
|
|
|
}
|
|
|
|
|
2020-01-09 00:59:30 +00:00
|
|
|
export default {
|
2020-07-02 23:28:22 +00:00
|
|
|
props: {
|
|
|
|
tag: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
poster,
|
|
|
|
photos,
|
|
|
|
},
|
2020-01-09 00:59:30 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.photos {
|
2020-07-02 23:28:22 +00:00
|
|
|
width: 100%;
|
2020-07-22 02:12:20 +00:00
|
|
|
padding: .5rem 1rem 0 .5rem;
|
2020-07-02 23:28:22 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
overflow-x: auto;
|
|
|
|
white-space: nowrap;
|
|
|
|
scrollbar-width: none;
|
|
|
|
scroll-behavior: smooth;
|
|
|
|
font-size: 0;
|
2020-01-09 00:59:30 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
&::-webkit-scrollbar {
|
2020-01-09 00:59:30 +00:00
|
|
|
display: none;
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
2020-01-09 00:59:30 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
&.expanded {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex-wrap: wrap;
|
2020-07-03 02:12:56 +00:00
|
|
|
padding: 0 0 0 1rem;
|
|
|
|
|
|
|
|
.photo-link {
|
|
|
|
margin: 0 .5rem .5rem 0;
|
|
|
|
}
|
2020-01-09 00:59:30 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.poster,
|
|
|
|
.photo {
|
2020-07-03 02:12:56 +00:00
|
|
|
max-height: 18rem;
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.photo-link:not(:last-child) {
|
|
|
|
margin: 0 .5rem 0 0;
|
2020-01-09 00:59:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.poster,
|
|
|
|
.photo {
|
2020-07-03 02:12:56 +00:00
|
|
|
max-height: 15rem;
|
|
|
|
max-width: 100%;
|
2020-07-02 23:28:22 +00:00
|
|
|
box-shadow: 0 0 3px var(--shadow-weak);
|
2020-01-09 00:59:30 +00:00
|
|
|
}
|
|
|
|
</style>
|