2019-02-02 14:11:36 -05:00
|
|
|
<template>
|
2022-03-21 20:59:25 +02:00
|
|
|
<span
|
2020-08-18 23:57:42 +03:00
|
|
|
class="Avatar"
|
2022-03-21 20:59:25 +02:00
|
|
|
:class="{ '-compact': compact }"
|
2022-03-29 15:35:18 +03:00
|
|
|
>
|
2022-03-21 20:59:25 +02:00
|
|
|
<StillImage
|
|
|
|
v-if="user"
|
|
|
|
class="avatar"
|
|
|
|
:alt="user.screen_name_ui"
|
|
|
|
:title="user.screen_name_ui"
|
|
|
|
:src="imgSrc(user.profile_image_url_original)"
|
|
|
|
:image-load-error="imageLoadError"
|
|
|
|
:class="{ '-compact': compact, '-better-shadow': betterShadow }"
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="avatar -placeholder"
|
|
|
|
:class="{ '-compact': compact }"
|
|
|
|
/>
|
2022-03-14 09:35:29 +02:00
|
|
|
<FAIcon
|
|
|
|
v-if="bot"
|
|
|
|
icon="robot"
|
|
|
|
class="bot-indicator"
|
|
|
|
/>
|
2022-03-21 20:59:25 +02:00
|
|
|
</span>
|
2019-02-02 14:11:36 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./user_avatar.js"></script>
|
2019-02-02 14:33:13 -05:00
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2020-08-18 23:57:42 +03:00
|
|
|
.Avatar {
|
2020-10-29 20:03:53 +02:00
|
|
|
--_avatarShadowBox: var(--avatarStatusShadow);
|
|
|
|
--_avatarShadowFilter: var(--avatarStatusShadowFilter);
|
|
|
|
--_avatarShadowInset: var(--avatarStatusShadowInset);
|
2020-10-29 21:39:36 +02:00
|
|
|
--_still-image-label-visibility: hidden;
|
2020-08-18 23:57:42 +03:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
2019-02-02 14:33:13 -05:00
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
2019-02-02 15:33:02 -05:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
&.-compact {
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
border-radius: $fallback--avatarAltRadius;
|
|
|
|
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
2019-02-02 15:33:02 -05:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2022-03-21 20:59:25 +02:00
|
|
|
box-shadow: var(--_avatarShadowBox);
|
|
|
|
border-radius: $fallback--avatarRadius;
|
|
|
|
border-radius: var(--avatarRadius, $fallback--avatarRadius);
|
2019-02-02 14:33:13 -05:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
&.-better-shadow {
|
|
|
|
box-shadow: var(--_avatarShadowInset);
|
|
|
|
filter: var(--_avatarShadowFilter);
|
|
|
|
}
|
2022-03-01 00:35:00 +03:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
&.-animated::before {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.-compact {
|
|
|
|
border-radius: $fallback--avatarAltRadius;
|
|
|
|
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
|
|
|
}
|
2019-02-02 14:33:13 -05:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
&.-placeholder {
|
|
|
|
background-color: $fallback--fg;
|
|
|
|
background-color: var(--fg, $fallback--fg);
|
|
|
|
}
|
2019-02-02 14:33:13 -05:00
|
|
|
}
|
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2019-02-02 14:33:13 -05:00
|
|
|
}
|
2020-09-06 15:28:09 +03:00
|
|
|
|
2022-03-21 20:59:25 +02:00
|
|
|
.bot-indicator {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: -0.2em;
|
|
|
|
padding: 0.2em;
|
|
|
|
background: rgba(127, 127, 127, 0.5);
|
|
|
|
color: #fff;
|
|
|
|
border-radius: var(--tooltipRadius);
|
2020-09-06 15:28:09 +03:00
|
|
|
}
|
2022-03-21 20:59:25 +02:00
|
|
|
|
2019-02-02 14:33:13 -05:00
|
|
|
}
|
|
|
|
</style>
|