elk/components/account/AccountAvatar.vue

32 lines
865 B
Vue
Raw Normal View History

<script setup lang="ts">
import type { Account } from 'masto'
defineProps<{
account: Account
2022-11-25 10:54:49 +00:00
hover?: boolean
}>()
2022-11-25 10:54:49 +00:00
defineOptions({
inheritAttrs: false,
})
</script>
<template>
2022-11-25 11:04:35 +00:00
<div v-if="hover" relative flex-shrink-0>
2022-11-25 10:54:49 +00:00
<div group>
2022-11-25 13:58:49 +00:00
<AccountHoverCard
:account="account"
absolute top-0 left-0 z-10
2022-11-26 20:48:06 +00:00
op0 pointer-events-none mt--100vh
font-normal delay-300 duration-400 transition transform invisible
group-hover="visible pointer-events-auto op100 mt-0"
2022-11-25 13:58:49 +00:00
translate="x-[calc(-1rem-1px)] y-[calc(-1rem-1px)]"
class="ease-[cubic-bezier(0.4, 0.0, 0.2, 1)]"
style="transform-origin: calc(1rem + 1px) calc(0.75rem + 1px);"
/>
2022-11-25 11:04:35 +00:00
<AccountAvatarImage :account="account" v-bind="$attrs" />
2022-11-25 10:54:49 +00:00
</div>
</div>
2022-11-25 11:04:35 +00:00
<AccountAvatarImage v-else :account="account" v-bind="$attrs" />
</template>