|
1 | 1 | <template>
|
2 |
| -<component :is="link ? MkA : 'span'" v-user-preview="preview ? user.id : undefined" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.cat]: user.isCat, [$style.square]: squareAvatars }]" :style="{ color }" :title="acct(user)" @click="onClick"> |
| 2 | +<component :is="link ? MkA : 'span'" v-user-preview="preview ? user.id : undefined" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.animation]: animation, [$style.cat]: user.isCat, [$style.square]: squareAvatars }]" :style="{ color }" :title="acct(user)" @click="onClick"> |
3 | 3 | <img :class="$style.inner" :src="url" decoding="async"/>
|
4 | 4 | <MkUserOnlineIndicator v-if="indicator" :class="$style.indicator" :user="user"/>
|
5 | 5 | <div v-if="user.isCat" :class="[$style.ears, { [$style.mask]: useBlurEffect }]">
|
@@ -27,6 +27,7 @@ import { acct, userPage } from '@/filters/user';
|
27 | 27 | import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue';
|
28 | 28 | import { defaultStore } from '@/store';
|
29 | 29 |
|
| 30 | +const animation = $ref(defaultStore.state.animation); |
30 | 31 | const squareAvatars = $ref(defaultStore.state.squareAvatars);
|
31 | 32 | const useBlurEffect = $ref(defaultStore.state.useBlurEffect);
|
32 | 33 |
|
@@ -86,6 +87,18 @@ watch(() => props.user.avatarBlurhash, () => {
|
86 | 87 | to { transform: rotate(-37.6deg) skew(-30deg); }
|
87 | 88 | }
|
88 | 89 |
|
| 90 | +@keyframes eartightleft { |
| 91 | + from { transform: rotate(37.6deg) skew(30deg); } |
| 92 | + 50% { transform: rotate(37.4deg) skew(30deg); } |
| 93 | + to { transform: rotate(37.6deg) skew(30deg); } |
| 94 | +} |
| 95 | +
|
| 96 | +@keyframes eartightright { |
| 97 | + from { transform: rotate(-37.6deg) skew(-30deg); } |
| 98 | + 50% { transform: rotate(-37.4deg) skew(-30deg); } |
| 99 | + to { transform: rotate(-37.6deg) skew(-30deg); } |
| 100 | +} |
| 101 | +
|
89 | 102 | .root {
|
90 | 103 | position: relative;
|
91 | 104 | display: inline-block;
|
@@ -144,6 +157,14 @@ watch(() => props.user.avatarBlurhash, () => {
|
144 | 157 | mask:
|
145 | 158 | url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><filter id="a"><feGaussianBlur in="SourceGraphic" stdDeviation="1"/></filter><circle cx="16" cy="16" r="15" filter="url(%23a)"/></svg>') exclude center / 50% 50%,
|
146 | 159 | linear-gradient(#fff, #fff); // polyfill of `image(#fff)`
|
| 160 | +
|
| 161 | + > .earLeft { |
| 162 | + animation: eartightleft 6s infinite; |
| 163 | + } |
| 164 | +
|
| 165 | + > .earRight { |
| 166 | + animation: eartightright 6s infinite; |
| 167 | + } |
147 | 168 | }
|
148 | 169 |
|
149 | 170 | > .earLeft,
|
@@ -225,7 +246,7 @@ watch(() => props.user.avatarBlurhash, () => {
|
225 | 246 | }
|
226 | 247 | }
|
227 | 248 |
|
228 |
| - &:hover { |
| 249 | + &.animation:hover { |
229 | 250 | > .ears {
|
230 | 251 | > .earLeft {
|
231 | 252 | animation: earwiggleleft 1s infinite;
|
|
0 commit comments