2023-12-30 05:29:53 +00:00
|
|
|
<template>
|
|
|
|
<div class="actor">
|
|
|
|
<span class="name">{{ actor.name }}</span>
|
|
|
|
|
|
|
|
<Link
|
|
|
|
:href="`/actor/${actor.id}/${actor.slug}`"
|
|
|
|
class="avatar-link no-link"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
v-if="actor.avatar"
|
|
|
|
:src="actor.avatar.isS3 ? `https://cdndev.traxxx.me/${actor.avatar.thumbnail}` : `/media/${actor.avatar.thumbnail}`"
|
|
|
|
:style="{ 'background-image': actor.avatar.isS3 ? `url(https://cdndev.traxxx.me/${actor.avatar.lazy})` : `url(/media/${actor.avatar.lazy})` }"
|
2024-01-07 01:35:24 +00:00
|
|
|
loading="lazy"
|
2023-12-30 05:29:53 +00:00
|
|
|
class="avatar"
|
|
|
|
>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<div class="details">
|
|
|
|
<span class="birth">
|
|
|
|
<Gender :gender="actor.gender" />
|
|
|
|
|
|
|
|
<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"
|
|
|
|
class="age age-then"
|
|
|
|
>{{ actor.ageThen }}</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span
|
2024-01-10 01:00:38 +00:00
|
|
|
v-if="actor.origin.country"
|
|
|
|
:title="`Born in ${actor.origin.country.name}`"
|
2023-12-30 05:29:53 +00:00
|
|
|
class="country"
|
|
|
|
>
|
2024-01-10 01:00:38 +00:00
|
|
|
{{ actor.origin.country.alpha2 }}
|
2023-12-30 05:29:53 +00:00
|
|
|
<img
|
2024-01-10 01:00:38 +00:00
|
|
|
:src="`/img/flags/${actor.origin.country.alpha2.toLowerCase()}.svg`"
|
2023-12-30 05:29:53 +00:00
|
|
|
class="flag"
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2024-01-10 01:00:38 +00:00
|
|
|
import { formatDate } from '#/utils/format.js';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
import Gender from './gender.vue';
|
|
|
|
|
|
|
|
defineProps({
|
|
|
|
actor: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.actor {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-01-04 00:49:16 +00:00
|
|
|
width: 100%;
|
|
|
|
aspect-ratio: 2/3;
|
2023-12-30 05:29:53 +00:00
|
|
|
position: relative;
|
|
|
|
border-radius: .25rem;
|
|
|
|
margin: .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);
|
|
|
|
|
|
|
|
.name {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
2024-01-05 23:30:30 +00:00
|
|
|
flex-shrink: 0;
|
2023-12-30 05:29:53 +00:00
|
|
|
padding: .25rem .5rem;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar-link {
|
|
|
|
display: block;
|
|
|
|
flex-grow: 1;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
object-fit: cover;
|
|
|
|
object-position: center 0;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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 {
|
|
|
|
color: var(--shadow-weak-10);
|
|
|
|
}
|
|
|
|
|
|
|
|
.country {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.flag {
|
|
|
|
height: .75rem;
|
|
|
|
margin-left: .25rem;
|
|
|
|
}
|
|
|
|
</style>
|