2019-11-14 04:13:38 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="actor"
|
|
|
|
class="actor"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
:href="`/actor/${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
|
|
|
|
|
|
|
<img
|
|
|
|
v-if="actor.avatar"
|
2019-11-30 04:55:32 +00:00
|
|
|
:src="`/media/${actor.avatar.thumbnail || actor.avatar}`"
|
2019-11-20 03:53:36 +00:00
|
|
|
class="avatar"
|
|
|
|
>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="avatar"
|
|
|
|
>No photo</span>
|
2019-12-10 21:35:00 +00:00
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="actor.age || actor.origin"
|
|
|
|
class="details"
|
|
|
|
>
|
2019-12-18 01:42:55 +00:00
|
|
|
<span>
|
2019-12-13 04:04:04 +00:00
|
|
|
<span
|
2019-12-18 01:42:55 +00:00
|
|
|
v-if="actor.age"
|
2019-12-13 04:04:04 +00:00
|
|
|
v-tooltip="`Born on ${formatDate(actor.birthdate, 'MMMM D, YYYY')}`"
|
|
|
|
class="age"
|
|
|
|
>{{ actor.age }}</span>
|
|
|
|
|
|
|
|
<span
|
|
|
|
v-if="actor.ageThen && actor.ageThen < actor.age"
|
2019-12-15 04:42:51 +00:00
|
|
|
v-tooltip="`${actor.ageThen} years old on release date`"
|
2019-12-13 04:04:04 +00:00
|
|
|
class="age-then"
|
2019-12-15 04:42:51 +00:00
|
|
|
>{{ actor.ageThen }}</span>
|
2019-12-13 04:04:04 +00:00
|
|
|
</span>
|
2019-12-10 21:35:00 +00:00
|
|
|
<span
|
|
|
|
v-if="actor.origin"
|
2019-12-13 04:04:04 +00:00
|
|
|
v-tooltip="`Born in ${actor.origin.country.alias || actor.origin.country.name}`"
|
2019-12-10 21:35:00 +00:00
|
|
|
class="country"
|
|
|
|
>
|
|
|
|
{{ actor.origin.country.alpha2 }}
|
|
|
|
<img
|
|
|
|
class="flag"
|
|
|
|
:src="`/img/flags/${actor.origin.country.alpha2.toLowerCase()}.png`"
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
</span>
|
2019-11-20 03:53:36 +00:00
|
|
|
</a>
|
2019-11-14 04:13:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
actor: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.actor {
|
2019-11-30 04:55:32 +00:00
|
|
|
width: 10rem;
|
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-12-10 21:35:00 +00:00
|
|
|
position: relative;
|
2019-11-14 04:13:38 +00:00
|
|
|
box-shadow: 0 0 3px $shadow-weak;
|
|
|
|
}
|
|
|
|
|
2019-11-20 03:53:36 +00:00
|
|
|
.link {
|
2019-11-14 04:13:38 +00:00
|
|
|
color: $link;
|
|
|
|
text-decoration: none;
|
2019-11-20 03:53:36 +00:00
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $primary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
display: block;
|
|
|
|
padding: .5rem;
|
2019-11-30 04:55:32 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2019-11-20 03:53:36 +00:00
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
color: $shadow-weak;
|
|
|
|
background: $shadow-hint;
|
|
|
|
height: 12rem;
|
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
|
|
|
|
|
|
|
.details {
|
|
|
|
background: $shadow;
|
|
|
|
color: $text-contrast;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
2019-12-15 04:42:51 +00:00
|
|
|
align-items: center;
|
2019-12-10 21:35:00 +00:00
|
|
|
justify-content: space-between;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: .5rem;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
font-size: .8rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2019-12-13 04:04:04 +00:00
|
|
|
|
|
|
|
.age-then {
|
|
|
|
color: $highlight;
|
|
|
|
}
|
2019-11-14 04:13:38 +00:00
|
|
|
</style>
|