2019-11-14 04:13:38 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="actor"
|
|
|
|
class="actor"
|
|
|
|
>
|
2020-01-30 23:03:05 +00:00
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actor', params: { actorSlug: actor.slug } }"
|
2019-11-20 03:53:36 +00:00
|
|
|
class="link"
|
|
|
|
>
|
2019-11-30 04:55:32 +00:00
|
|
|
<span
|
|
|
|
v-tooltip.top="actor.name"
|
|
|
|
class="name"
|
|
|
|
>{{ actor.name }}</span>
|
2019-11-20 03:53:36 +00:00
|
|
|
|
2020-01-25 00:26:13 +00:00
|
|
|
<div class="avatar-container">
|
|
|
|
<img
|
|
|
|
v-if="actor.avatar"
|
|
|
|
:src="`/media/${actor.avatar.thumbnail || actor.avatar}`"
|
|
|
|
class="avatar"
|
|
|
|
>
|
2019-12-10 21:35:00 +00:00
|
|
|
|
2020-01-25 00:26:13 +00:00
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="avatar"
|
|
|
|
><img
|
|
|
|
:src="`/img/avatar_${actor.gender || 'female'}.png`"
|
|
|
|
class="avatar-fallback"
|
|
|
|
></span>
|
2019-12-13 04:04:04 +00:00
|
|
|
|
2019-12-10 21:35:00 +00:00
|
|
|
<span
|
2020-01-25 00:26:13 +00:00
|
|
|
class="details"
|
2019-12-10 21:35:00 +00:00
|
|
|
>
|
2020-01-25 00:26:13 +00:00
|
|
|
<span class="age">
|
|
|
|
<span
|
|
|
|
v-if="actor.age"
|
|
|
|
v-tooltip="`Born on ${formatDate(actor.birthdate, 'MMMM D, YYYY')}`"
|
|
|
|
class="age-now"
|
|
|
|
>{{ actor.age }}</span>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="actor.ageThen && actor.ageThen < actor.age"
|
|
|
|
v-tooltip="`${actor.ageThen} years old on release date`"
|
|
|
|
class="age-then"
|
|
|
|
>{{ actor.ageThen }}</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<Gender :gender="actor.gender" />
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="actor.origin"
|
|
|
|
v-tooltip="`Born in ${actor.origin.country.alias || actor.origin.country.name}`"
|
|
|
|
class="country"
|
2019-12-10 21:35:00 +00:00
|
|
|
>
|
2020-01-25 00:26:13 +00:00
|
|
|
{{ actor.origin.country.alpha2 }}
|
|
|
|
<img
|
|
|
|
class="flag"
|
|
|
|
:src="`/img/flags/${actor.origin.country.alpha2.toLowerCase()}.png`"
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="country"
|
|
|
|
/>
|
2019-12-10 21:35:00 +00:00
|
|
|
</span>
|
2020-01-25 00:26:13 +00:00
|
|
|
</div>
|
2020-01-30 23:03:05 +00:00
|
|
|
</router-link>
|
2019-11-14 04:13:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-01-25 00:26:13 +00:00
|
|
|
import Gender from '../actors/gender.vue';
|
|
|
|
|
2019-11-14 04:13:38 +00:00
|
|
|
export default {
|
2020-01-25 00:26:13 +00:00
|
|
|
components: {
|
|
|
|
Gender,
|
|
|
|
},
|
2019-11-14 04:13:38 +00:00
|
|
|
props: {
|
|
|
|
actor: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.actor {
|
2020-01-06 20:49:37 +00:00
|
|
|
width: 100%;
|
2019-11-14 04:13:38 +00:00
|
|
|
background: $background;
|
|
|
|
display: inline-block;
|
2019-11-20 03:53:36 +00:00
|
|
|
margin: 0 .5rem .5rem 0;
|
2019-11-14 04:13:38 +00:00
|
|
|
box-shadow: 0 0 3px $shadow-weak;
|
|
|
|
}
|
|
|
|
|
2019-11-20 03:53:36 +00:00
|
|
|
.link {
|
2020-01-25 00:26:13 +00:00
|
|
|
color: $text;
|
2019-11-14 04:13:38 +00:00
|
|
|
text-decoration: none;
|
2019-11-20 03:53:36 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $primary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-25 00:26:13 +00:00
|
|
|
.avatar-container {
|
|
|
|
position: relative;
|
2019-11-20 03:53:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
color: $shadow-weak;
|
|
|
|
background: $shadow-hint;
|
2020-01-25 00:26:13 +00:00
|
|
|
height: 13rem;
|
2019-11-30 04:55:32 +00:00
|
|
|
width: 100%;
|
2019-11-20 03:53:36 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
object-fit: cover;
|
2019-11-30 04:55:32 +00:00
|
|
|
object-position: 50% 0;
|
2019-11-14 04:13:38 +00:00
|
|
|
}
|
2019-12-10 21:35:00 +00:00
|
|
|
|
2020-01-23 02:52:12 +00:00
|
|
|
.avatar-fallback {
|
|
|
|
max-height: 75%;
|
|
|
|
max-width: 80%;
|
|
|
|
opacity: .1;
|
|
|
|
}
|
|
|
|
|
2019-12-10 21:35:00 +00:00
|
|
|
.details {
|
|
|
|
background: $shadow;
|
|
|
|
color: $text-contrast;
|
|
|
|
width: 100%;
|
2020-01-23 02:52:12 +00:00
|
|
|
height: 1.75rem;
|
2019-12-10 21:35:00 +00:00
|
|
|
display: flex;
|
2019-12-15 04:42:51 +00:00
|
|
|
align-items: center;
|
2019-12-10 21:35:00 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: .5rem;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
font-size: .8rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2019-12-13 04:04:04 +00:00
|
|
|
|
2020-01-25 00:26:13 +00:00
|
|
|
.age,
|
|
|
|
.country,
|
|
|
|
.gender {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.gender {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.country {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
2019-12-13 04:04:04 +00:00
|
|
|
.age-then {
|
|
|
|
color: $highlight;
|
|
|
|
}
|
2020-01-25 00:26:13 +00:00
|
|
|
|
|
|
|
.name {
|
|
|
|
display: block;
|
|
|
|
padding: .5rem;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2019-11-14 04:13:38 +00:00
|
|
|
</style>
|