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