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