Skip to content

Commit

Permalink
fix(ui): Profile avatar image motion setting #3044 (#3066)
Browse files Browse the repository at this point in the history
Co-authored-by: null <null>
  • Loading branch information
AndrewCrescencio authored Nov 27, 2024
1 parent 5753f0b commit 008248e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/account/AccountAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineProps<{
const { account, square } = defineProps<{
account: mastodon.v1.Account
square?: boolean
}>()
const loaded = ref(false)
const error = ref(false)
const preferredMotion = usePreferredReducedMotion()
const accountAvatarSrc = computed(() => {
return preferredMotion.value === 'reduce' ? account.avatarStatic : account.avatar
})
</script>

<template>
Expand All @@ -16,7 +21,7 @@ const error = ref(false)
width="400"
height="400"
select-none
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : account.avatar"
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : accountAvatarSrc"
:alt="$t('account.avatar_description', [account.username])"
loading="lazy"
class="account-avatar"
Expand Down

0 comments on commit 008248e

Please sign in to comment.