Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Aug 20, 2024
1 parent 59e8360 commit 1b5f057
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/frontend/src/components/global/MkAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-if="showDecoration">
<img
v-for="decoration in decorations ?? user.avatarDecorations"
:class="[$style.decoration]"
:class="[$style.decoration, { [$style.decorationBlink]: decoration.blink }]"
:src="getDecorationUrl(decoration)"
:style="{
rotate: getDecorationAngle(decoration),
Expand Down Expand Up @@ -60,7 +60,7 @@ const props = withDefaults(defineProps<{
link?: boolean;
preview?: boolean;
indicator?: boolean;
decorations?: Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'>[];
decorations?: (Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'> & { blink?: boolean; })[];
forceShowDecoration?: boolean;
}>(), {
target: null,
Expand Down Expand Up @@ -330,4 +330,17 @@ watch(() => props.user.avatarBlurhash, () => {
width: 200%;
pointer-events: none;
}

.decorationBlink {
animation: blink 1s infinite;
}

@keyframes blink {
0%, 100% {
filter: brightness(2);
}
50% {
filter: brightness(1);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const decorationsForPreview = computed(() => {
flipH: flipH.value,
offsetX: offsetX.value,
offsetY: offsetY.value,
blink: true,
};
const decorations = [...$i.avatarDecorations];
if (props.usingIndex != null) {
Expand Down

0 comments on commit 1b5f057

Please sign in to comment.