2019-11-30 04:55:32 +00:00
|
|
|
<template>
|
2020-05-16 02:36:45 +00:00
|
|
|
<div
|
2020-05-21 02:27:45 +00:00
|
|
|
v-lazy-container
|
2020-05-16 02:36:45 +00:00
|
|
|
class="photos"
|
2020-05-21 02:27:45 +00:00
|
|
|
:class="{
|
|
|
|
avatar: !!actor.avatar,
|
|
|
|
empty: actor.photos.length === 0,
|
|
|
|
wide: actor.photos.length > 2
|
|
|
|
}"
|
2020-05-16 02:36:45 +00:00
|
|
|
>
|
|
|
|
<a
|
|
|
|
v-if="actor.avatar"
|
|
|
|
:href="`/media/${actor.avatar.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="avatar-link photo-link"
|
|
|
|
>
|
|
|
|
<img
|
2020-05-21 02:27:45 +00:00
|
|
|
:data-src="sfw ? `/img/${actor.avatar.sfw.thumbnail}` : `/media/${actor.avatar.thumbnail}`"
|
|
|
|
:data-loading="sfw ? `/img/${actor.avatar.sfw.lazy}` : `/media/${actor.avatar.lazy}`"
|
2020-05-16 02:36:45 +00:00
|
|
|
:title="actor.avatar.copyright && `© ${actor.avatar.copyright}`"
|
|
|
|
class="avatar photo"
|
|
|
|
>
|
|
|
|
</a>
|
2019-11-30 04:55:32 +00:00
|
|
|
|
2020-05-16 02:36:45 +00:00
|
|
|
<a
|
|
|
|
v-for="photo in actor.photos"
|
|
|
|
:key="`photo-${photo.id}`"
|
|
|
|
:href="`/media/${photo.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="photo-link"
|
|
|
|
>
|
|
|
|
<img
|
2020-05-21 02:27:45 +00:00
|
|
|
:data-src="sfw ? `/img/${photo.sfw.thumbnail}` : `/media/${photo.thumbnail}`"
|
|
|
|
:data-loading="sfw ? `/img/${photo.sfw.lazy}` : `/media/${photo.lazy}`"
|
2020-05-16 02:36:45 +00:00
|
|
|
:title="photo.copyright && `© ${photo.copyright}`"
|
|
|
|
class="photo"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
</div>
|
2019-11-30 04:55:32 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-05-17 23:22:56 +00:00
|
|
|
function sfw() {
|
|
|
|
return this.$store.state.ui.sfw;
|
|
|
|
}
|
|
|
|
|
2019-11-30 04:55:32 +00:00
|
|
|
export default {
|
2020-05-16 02:36:45 +00:00
|
|
|
props: {
|
|
|
|
actor: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
2020-05-17 23:22:56 +00:00
|
|
|
computed: {
|
|
|
|
sfw,
|
|
|
|
},
|
2019-11-30 04:55:32 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.photos {
|
2020-05-21 02:27:45 +00:00
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
2020-05-21 22:55:11 +00:00
|
|
|
border-bottom: solid 1px var(--darken-hint);
|
2019-11-30 04:55:32 +00:00
|
|
|
font-size: 0;
|
2020-05-21 02:27:45 +00:00
|
|
|
overflow-x: scroll;
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
&.empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
|
|
|
|
.avatar-link {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-01-09 16:16:28 +00:00
|
|
|
|
2020-05-21 02:27:45 +00:00
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.photo-link {
|
2020-05-21 02:27:45 +00:00
|
|
|
height: 16rem;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin: 0 .5rem 0 0;
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.photo {
|
|
|
|
height: 100%;
|
|
|
|
box-shadow: 0 0 3px $shadow-weak;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint3) {
|
2020-05-21 02:27:45 +00:00
|
|
|
.photos {
|
|
|
|
&.empty.avatar {
|
|
|
|
display: flex;
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
|
2020-05-21 02:27:45 +00:00
|
|
|
.avatar-link {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|