fix(ui): Profile avatar image motion setting ()

Co-authored-by: null <null>
This commit is contained in:
Andrew Crescencio 2024-11-27 06:09:33 -03:00 committed by GitHub
parent 5753f0b869
commit 008248ee0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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>
@ -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"