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"
|
2021-02-22 01:33:39 +00:00
|
|
|
:href="getPath(actor.avatar)"
|
2020-05-16 02:36:45 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="avatar-link photo-link"
|
|
|
|
>
|
|
|
|
<img
|
2021-02-22 01:33:39 +00:00
|
|
|
:src="getPath(actor.avatar, 'thumbnail')"
|
|
|
|
:style="{ 'background-image': getBgPath(actor.avatar, 'lazy') }"
|
2020-07-15 03:12:29 +00:00
|
|
|
:title="actor.avatar.credit && `© ${actor.avatar.credit}`"
|
2021-03-18 03:36:04 +00:00
|
|
|
:width="actor.avatar.thumbnailWidth"
|
|
|
|
:height="actor.avatar.thumbnailHeight"
|
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}`"
|
2021-02-22 01:33:39 +00:00
|
|
|
:href="getPath(photo)"
|
2020-05-16 02:36:45 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="photo-link"
|
|
|
|
>
|
|
|
|
<img
|
2021-02-22 01:33:39 +00:00
|
|
|
:src="getPath(photo, 'thumbnail')"
|
|
|
|
:style="{ 'background-image': getBgPath(photo, 'lazy') }"
|
2020-07-15 03:12:29 +00:00
|
|
|
:title="`© ${photo.credit || photo.entity.name}`"
|
2021-03-18 03:36:04 +00:00
|
|
|
:width="photo.thumbnailWidth"
|
|
|
|
:height="photo.thumbnailHeight"
|
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() {
|
2021-03-11 03:16:59 +00:00
|
|
|
return this.actor.photos.filter(photo => !photo.entropy || photo.entropy > 5.5);
|
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>
|