2019-11-30 04:55:32 +00:00
|
|
|
<template>
|
2020-05-16 02:36:45 +00:00
|
|
|
<div
|
|
|
|
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-12-27 21:45:38 +00:00
|
|
|
v-if="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-12-26 22:51:27 +00:00
|
|
|
:style="{ 'background-image': sfw ? `/img/${actor.avatar.sfw.lazy}` : `/media/${actor.avatar.lazy}` }"
|
2020-07-15 03:12:29 +00:00
|
|
|
:title="actor.avatar.credit && `© ${actor.avatar.credit}`"
|
2020-12-26 22:51:27 +00:00
|
|
|
loading="lazy"
|
2020-05-16 02:36:45 +00:00
|
|
|
class="avatar photo"
|
2020-12-29 03:20:13 +00:00
|
|
|
@load="$emit('load', $event)"
|
2020-05-16 02:36:45 +00:00
|
|
|
>
|
|
|
|
</a>
|
2019-11-30 04:55:32 +00:00
|
|
|
|
2020-05-16 02:36:45 +00:00
|
|
|
<a
|
2020-12-20 03:21:28 +00:00
|
|
|
v-for="photo in photos"
|
2020-05-16 02:36:45 +00:00
|
|
|
: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-12-26 22:51:27 +00:00
|
|
|
:style="{ 'background-image': sfw ? `/img/${photo.sfw.lazy}` : `/media/${photo.lazy}` }"
|
2020-07-15 03:12:29 +00:00
|
|
|
:title="`© ${photo.credit || photo.entity.name}`"
|
2020-12-26 22:51:27 +00:00
|
|
|
loading="lazy"
|
2020-05-16 02:36:45 +00:00
|
|
|
class="photo"
|
2020-12-29 03:20:13 +00:00
|
|
|
@load="$emit('load', $event)"
|
2020-05-16 02:36:45 +00:00
|
|
|
>
|
|
|
|
</a>
|
|
|
|
</div>
|
2019-11-30 04:55:32 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-20 03:21:28 +00:00
|
|
|
function photos() {
|
2020-12-29 23:19:08 +00:00
|
|
|
return this.actor.photos.filter(photo => !photo.entropy || photo.entropy > 6);
|
2020-12-20 03:21:28 +00:00
|
|
|
}
|
|
|
|
|
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-12-29 03:20:13 +00:00
|
|
|
emits: ['load'],
|
2020-05-17 23:22:56 +00:00
|
|
|
computed: {
|
|
|
|
sfw,
|
2020-12-20 03:21:28 +00:00
|
|
|
photos,
|
2020-05-17 23:22:56 +00:00
|
|
|
},
|
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
|
|
|
|
2020-06-29 01:55:10 +00:00
|
|
|
&.expanded {
|
2020-06-29 23:07:48 +00:00
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: center;
|
2020-07-07 17:23:36 +00:00
|
|
|
margin: 0;
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.photo-link {
|
2020-12-29 03:20:13 +00:00
|
|
|
padding: 0 .5rem 0 0;
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
padding: 0 1rem 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;
|
2020-12-27 22:10:11 +00:00
|
|
|
background-position: center;
|
2020-12-26 22:51:27 +00:00
|
|
|
background-size: cover;
|
2020-06-29 01:55:10 +00:00
|
|
|
}
|
|
|
|
|
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>
|