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,
|
|
|
|
}"
|
2020-05-16 02:36:45 +00:00
|
|
|
>
|
|
|
|
<a
|
2020-06-29 01:55:10 +00:00
|
|
|
v-show="actor.avatar"
|
2020-05-16 02:36:45 +00:00
|
|
|
:href="`/media/${actor.avatar.path}`"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="avatar-link photo-link"
|
|
|
|
>
|
|
|
|
<img
|
2020-06-29 01:55:10 +00:00
|
|
|
:src="sfw ? `/img/${actor.avatar.sfw.thumbnail}` : `/media/${actor.avatar.thumbnail}`"
|
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-06-29 01:55:10 +00:00
|
|
|
:src="sfw ? `/img/${photo.sfw.thumbnail}` : `/media/${photo.thumbnail}`"
|
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-06-29 01:55:10 +00:00
|
|
|
:title="`© ${photo.copyright || photo.entity.name}`"
|
2020-05-16 02:36:45 +00:00
|
|
|
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
|
|
|
display: flex;
|
|
|
|
box-sizing: border-box;
|
2020-06-29 01:55:10 +00:00
|
|
|
padding: .5rem 1rem;
|
2019-11-30 04:55:32 +00:00
|
|
|
font-size: 0;
|
2020-05-21 02:27:45 +00:00
|
|
|
overflow-x: scroll;
|
2020-06-29 01:55:10 +00:00
|
|
|
scroll-behavior: smooth;
|
2020-05-21 02:27:45 +00:00
|
|
|
scrollbar-width: none;
|
|
|
|
|
2020-06-29 01:55:10 +00:00
|
|
|
&.expanded {
|
2020-06-29 23:07:48 +00:00
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
/*
|
2020-06-29 01:55:10 +00:00
|
|
|
display: grid;
|
|
|
|
grid-gap: .5rem;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
|
2020-06-29 23:07:48 +00:00
|
|
|
*/
|
2020-06-29 01:55:10 +00:00
|
|
|
|
|
|
|
.photo-link {
|
2020-06-29 23:07:48 +00:00
|
|
|
margin: 0 .5rem .5rem 0;
|
2020-06-29 01:55:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.photo {
|
2020-06-29 23:07:48 +00:00
|
|
|
height: 18rem;
|
2020-06-29 01:55:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-21 02:27:45 +00:00
|
|
|
&.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
|
|
|
margin: 0 .5rem 0 0;
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.photo {
|
2020-06-29 01:55:10 +00:00
|
|
|
height: 15rem;
|
2020-07-05 02:27:46 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
2020-06-29 01:55:10 +00:00
|
|
|
object-fit: cover;
|
|
|
|
}
|
|
|
|
|
2019-11-30 04:55:32 +00:00
|
|
|
@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;
|
|
|
|
}
|
2020-06-29 01:55:10 +00:00
|
|
|
|
|
|
|
&.expanded {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint0) {
|
|
|
|
.photos.expanded {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|