2023-12-30 05:29:53 +00:00
|
|
|
<template>
|
2024-03-21 01:54:05 +00:00
|
|
|
<div
|
|
|
|
class="tile"
|
|
|
|
:class="{
|
2024-03-27 02:15:37 +00:00
|
|
|
unstashed: !favorited && pageStash && user && pageStash.user.id === user?.id,
|
2024-03-21 01:54:05 +00:00
|
|
|
}"
|
|
|
|
>
|
|
|
|
<div class="avatar-container">
|
|
|
|
<Link
|
|
|
|
:href="`/actor/${actor.id}/${actor.slug}`"
|
|
|
|
class="avatar-link no-link"
|
2023-12-30 05:29:53 +00:00
|
|
|
>
|
2024-03-21 01:54:05 +00:00
|
|
|
<img
|
|
|
|
v-if="actor.avatar"
|
2024-05-19 03:07:35 +00:00
|
|
|
:src="getPath(actor.avatar, 'thumbnail')"
|
|
|
|
:style="{ 'background-image': `url(${getPath(actor.avatar, 'lazy')})` }"
|
2024-03-21 01:54:05 +00:00
|
|
|
loading="lazy"
|
|
|
|
class="avatar"
|
|
|
|
>
|
2024-03-23 21:44:49 +00:00
|
|
|
|
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
:src="`/img/avatars/${actor.gender || 'female'}.svg`"
|
|
|
|
loading="lazy"
|
|
|
|
class="fallback"
|
|
|
|
>
|
2024-03-21 01:54:05 +00:00
|
|
|
</Link>
|
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
<Heart
|
|
|
|
domain="actors"
|
|
|
|
:item="actor"
|
|
|
|
:show-secondary="false"
|
|
|
|
class="light tiled"
|
2024-03-27 02:05:32 +00:00
|
|
|
@stashed="(stash) => { favorited = stash.id === currentStash.id ? true : favorited; }"
|
|
|
|
@unstashed="(stash) => { favorited = stash.id === currentStash.id ? false : favorited; }"
|
2024-03-21 01:54:05 +00:00
|
|
|
/>
|
2023-12-30 05:29:53 +00:00
|
|
|
|
2024-06-02 03:22:08 +00:00
|
|
|
<div class="details">
|
|
|
|
<span class="birth">
|
|
|
|
<Gender :gender="actor.gender" />
|
2023-12-30 05:29:53 +00:00
|
|
|
|
2024-06-02 03:22:08 +00:00
|
|
|
<span
|
|
|
|
v-if="actor.ageFromBirth"
|
|
|
|
:title="`Born ${formatDate(actor.dateOfBirth, 'MMMM d, yyyy')}`"
|
|
|
|
class="age"
|
|
|
|
>{{ actor.ageFromBirth }}</span>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="actor.ageThen && actor.ageThen < actor.ageFromBirth"
|
|
|
|
title="Age on date of release"
|
|
|
|
class="age age-then"
|
|
|
|
>{{ actor.ageThen }}</span>
|
|
|
|
</span>
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
<span
|
2024-06-02 03:22:08 +00:00
|
|
|
v-if="actor.origin?.country"
|
|
|
|
:title="`Born in ${actor.origin.country.alias || actor.origin.country.name}`"
|
|
|
|
class="country"
|
2023-12-30 05:29:53 +00:00
|
|
|
>
|
2024-06-02 03:22:08 +00:00
|
|
|
{{ actor.origin.country.alpha2 }}
|
|
|
|
<img
|
|
|
|
:src="`/img/flags/${actor.origin.country.alpha2.toLowerCase()}.svg`"
|
|
|
|
class="flag"
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
</div>
|
2023-12-30 05:29:53 +00:00
|
|
|
</div>
|
2024-06-02 03:22:08 +00:00
|
|
|
|
|
|
|
<span class="name">{{ actor.name }}</span>
|
2023-12-30 05:29:53 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2024-03-21 01:54:05 +00:00
|
|
|
import { ref, inject } from 'vue';
|
|
|
|
|
2024-05-19 03:07:35 +00:00
|
|
|
import getPath from '#/src/get-path.js';
|
2024-01-10 01:00:38 +00:00
|
|
|
import { formatDate } from '#/utils/format.js';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
import Heart from '#/components/stashes/heart.vue';
|
2023-12-30 05:29:53 +00:00
|
|
|
import Gender from './gender.vue';
|
|
|
|
|
2024-03-21 01:54:05 +00:00
|
|
|
const props = defineProps({
|
2023-12-30 05:29:53 +00:00
|
|
|
actor: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
});
|
2024-03-21 01:54:05 +00:00
|
|
|
|
|
|
|
const pageContext = inject('pageContext');
|
|
|
|
const { user } = pageContext;
|
|
|
|
const pageStash = pageContext.pageProps.stash;
|
2024-03-27 02:15:37 +00:00
|
|
|
const currentStash = pageStash || user?.primaryStash;
|
2024-03-21 01:54:05 +00:00
|
|
|
|
2024-03-27 02:05:32 +00:00
|
|
|
const favorited = ref(props.actor.stashes.some((actorStash) => actorStash.id === currentStash.id));
|
2023-12-30 05:29:53 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2024-03-21 01:54:05 +00:00
|
|
|
.tile {
|
2023-12-30 05:29:53 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-01-04 00:49:16 +00:00
|
|
|
width: 100%;
|
2023-12-30 05:29:53 +00:00
|
|
|
position: relative;
|
2024-06-02 03:22:08 +00:00
|
|
|
aspect-ratio: 3/5;
|
2023-12-30 05:29:53 +00:00
|
|
|
border-radius: .25rem;
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak-30);
|
2024-01-04 00:49:16 +00:00
|
|
|
overflow: hidden;
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak-20);
|
|
|
|
|
2024-03-27 01:28:21 +00:00
|
|
|
:deep(.bookmarks) .icon:not(.favorited):not(:hover) {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
2024-03-21 01:54:05 +00:00
|
|
|
|
|
|
|
&.unstashed {
|
|
|
|
opacity: .5;
|
|
|
|
}
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
2024-01-05 23:30:30 +00:00
|
|
|
flex-shrink: 0;
|
2024-06-02 03:22:08 +00:00
|
|
|
padding: .35rem .5rem;
|
2023-12-30 05:29:53 +00:00
|
|
|
font-weight: bold;
|
|
|
|
font-size: .9rem;
|
2024-01-04 00:49:16 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2023-12-30 05:29:53 +00:00
|
|
|
user-select: all;
|
|
|
|
}
|
|
|
|
|
2024-03-21 01:54:05 +00:00
|
|
|
.avatar-container {
|
|
|
|
position: relative;
|
|
|
|
flex-grow: 1;
|
2024-03-23 21:44:49 +00:00
|
|
|
overflow: hidden;
|
|
|
|
background: var(--grey-dark-40);
|
2024-03-21 01:54:05 +00:00
|
|
|
}
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
.avatar-link {
|
2024-03-21 01:54:05 +00:00
|
|
|
height: 100%;
|
2023-12-30 05:29:53 +00:00
|
|
|
display: block;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
object-fit: cover;
|
|
|
|
object-position: center 0;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center 0;
|
|
|
|
}
|
|
|
|
|
2024-03-23 21:44:49 +00:00
|
|
|
.fallback {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
display: block;
|
|
|
|
object-fit: contain;
|
|
|
|
opacity: .1;
|
|
|
|
}
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
.details {
|
|
|
|
width: 100%;
|
|
|
|
height: 1.5rem;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
2024-01-03 01:52:41 +00:00
|
|
|
box-sizing: border-box;
|
2023-12-30 05:29:53 +00:00
|
|
|
padding: 0 .5rem;
|
|
|
|
color: var(--text-light);
|
|
|
|
background: var(--shadow);
|
|
|
|
font-size: .9rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.gender {
|
|
|
|
display: inline-block;
|
|
|
|
padding: .25rem 0;
|
|
|
|
margin-right: .25rem;
|
|
|
|
transform: translateY(1px);
|
|
|
|
}
|
|
|
|
|
|
|
|
.birth {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.age {
|
|
|
|
margin-right: .25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.age-then {
|
2024-03-19 19:50:50 +00:00
|
|
|
color: var(--grey-light-20);
|
|
|
|
font-weight: normal;
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.country {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.flag {
|
|
|
|
height: .75rem;
|
|
|
|
margin-left: .25rem;
|
|
|
|
}
|
|
|
|
</style>
|