diff options
| author | Henry Jameson <me@hjkos.com> | 2022-03-21 21:09:48 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-03-21 21:09:48 +0200 |
| commit | 54fd7e2be6e8dcbe3c57deb5c3688916cbc53648 (patch) | |
| tree | 20f85042b453b3b1c13b88b05f19f16431c18444 /src | |
| parent | 5948d20f00a4b01bee143a617bea9ae40cb1243f (diff) | |
| parent | 0ef58696bf6767f54083049f0c218816449d486d (diff) | |
Merge remote-tracking branch 'origin/develop' into vue3-again
* origin/develop:
improve the looks of bot indicator
fix bot indicator appearing on retweeter avatar
Update dependency localforage to v1.10.0
Update dependency http-proxy-middleware to v0.21.0
Update dependency eslint-plugin-standard to v4.1.0
Update dependency eslint-plugin-import to v2.25.4
Update babel monorepo to v7.17.8
Update dependency iso-639-1 to v2.1.13
Update dependency express to v4.17.3
Update dependency eslint-plugin-promise to v4.3.1
Update dependency eslint-loader to v2.2.1
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/status/status.js | 6 | ||||
| -rw-r--r-- | src/components/status/status.vue | 2 | ||||
| -rw-r--r-- | src/components/user_avatar/user_avatar.vue | 98 |
3 files changed, 67 insertions, 39 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 4c0ef3e0..e54be241 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -225,12 +225,18 @@ const Status = { muteWordHits () { return muteWordHits(this.status, this.muteWords) }, + rtBotStatus () { + return this.statusoid.user.bot + }, botStatus () { return this.status.user.bot }, botIndicator () { return this.botStatus && !this.hideBotIndication }, + rtBotIndicator () { + return this.rtBotStatus && !this.hideBotIndication + }, mentionsLine () { if (!this.headTailLinks) return [] const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url)) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f778753f..ca7f0f72 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -78,7 +78,7 @@ <UserAvatar v-if="retweet" class="left-side repeater-avatar" - :bot="botIndicator" + :bot="rtBotIndicator" :better-shadow="betterShadow" :user="statusoid.user" /> diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 847d654b..b19ce89b 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -1,24 +1,28 @@ <template> - <StillImage - v-if="user" + <span class="Avatar" - :alt="user.screen_name_ui" - :title="user.screen_name_ui" - :src="imgSrc(user.profile_image_url_original)" - :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" - :image-load-error="imageLoadError" - > + :class="{ '-compact': compact }" + > + <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 }" + /> <FAIcon v-if="bot" icon="robot" class="bot-indicator" /> - </StillImage> - <div - v-else - class="Avatar -placeholder" - :class="{ 'avatar-compact': compact }" - /> + </span> </template> <script src="./user_avatar.js"></script> @@ -31,42 +35,60 @@ --_avatarShadowInset: var(--avatarStatusShadowInset); --_still-image-label-visibility: hidden; + display: inline-block; + position: relative; width: 48px; height: 48px; - box-shadow: var(--_avatarShadowBox); - border-radius: $fallback--avatarRadius; - border-radius: var(--avatarRadius, $fallback--avatarRadius); - img { + &.-compact { + width: 32px; + height: 32px; + border-radius: $fallback--avatarAltRadius; + border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius); + } + + .avatar { width: 100%; height: 100%; - } + box-shadow: var(--_avatarShadowBox); + border-radius: $fallback--avatarRadius; + border-radius: var(--avatarRadius, $fallback--avatarRadius); - & > .bot-indicator { - position: absolute; - bottom: 0; - right: 0; - } + &.-better-shadow { + box-shadow: var(--_avatarShadowInset); + filter: var(--_avatarShadowFilter); + } - &.better-shadow { - box-shadow: var(--_avatarShadowInset); - filter: var(--_avatarShadowFilter); - } + &.-animated::before { + display: none; + } + + &.-compact { + border-radius: $fallback--avatarAltRadius; + border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius); + } - &.animated::before { - display: none; + &.-placeholder { + background-color: $fallback--fg; + background-color: var(--fg, $fallback--fg); + } } - &.avatar-compact { - width: 32px; - height: 32px; - border-radius: $fallback--avatarAltRadius; - border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius); + img { + width: 100%; + height: 100%; } - &.-placeholder { - background-color: $fallback--fg; - background-color: var(--fg, $fallback--fg); + .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); } + } </style> |
