Skip to content

Commit 58f3a2e

Browse files
authored
Merge pull request #10420 from misskey-dev/acid-chicken-patch-1
fix: #10413
2 parents da6b30c + 8a9847b commit 58f3a2e

File tree

3 files changed

+43
-8
lines changed

3 files changed

+43
-8
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
-
66
77
### Client
8-
-
8+
- 「にゃああああああああああああああ!!!!!!!!!!!!」 (`isCat`) 有効時にアバターに表示される猫耳について挙動を変更
9+
- 「UIにぼかし効果を使用」 (`useBlurEffect`) で次の挙動が有効になります
10+
- 猫耳のアバター内部部分をぼかしでマスク表示してより猫耳っぽく見えるように
11+
- 猫耳の色がアバター上部のピクセルから決定されます(無効化時はアバター全体の平均色)
12+
- 左耳は上からおよそ 10%, 左からおよそ 20% の位置で決定します
13+
- 右耳は上からおよそ 10%, 左からおよそ 80% の位置で決定します
14+
- 「UIのアニメーションを減らす」 (`reduceAnimation`) で猫耳を撫でられなくなります
915
1016
### Server
1117
-

packages/frontend/src/components/global/MkAvatar.vue

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<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">
33
<img :class="$style.inner" :src="url" decoding="async"/>
44
<MkUserOnlineIndicator v-if="indicator" :class="$style.indicator" :user="user"/>
55
<div v-if="user.isCat" :class="[$style.ears, { [$style.mask]: useBlurEffect }]">
@@ -27,6 +27,7 @@ import { acct, userPage } from '@/filters/user';
2727
import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue';
2828
import { defaultStore } from '@/store';
2929
30+
const animation = $ref(defaultStore.state.animation);
3031
const squareAvatars = $ref(defaultStore.state.squareAvatars);
3132
const useBlurEffect = $ref(defaultStore.state.useBlurEffect);
3233
@@ -86,6 +87,18 @@ watch(() => props.user.avatarBlurhash, () => {
8687
to { transform: rotate(-37.6deg) skew(-30deg); }
8788
}
8889
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+
89102
.root {
90103
position: relative;
91104
display: inline-block;
@@ -144,6 +157,14 @@ watch(() => props.user.avatarBlurhash, () => {
144157
mask:
145158
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%,
146159
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+
}
147168
}
148169
149170
> .earLeft,
@@ -225,7 +246,7 @@ watch(() => props.user.avatarBlurhash, () => {
225246
}
226247
}
227248
228-
&:hover {
249+
&.animation:hover {
229250
> .ears {
230251
> .earLeft {
231252
animation: earwiggleleft 1s infinite;

packages/frontend/src/components/global/MkPageHeader.vue

+13-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
<template v-if="metadata">
1010
<div v-if="!hideTitle" :class="$style.titleContainer" @click="top">
11-
<MkAvatar v-if="metadata.avatar" :class="$style.titleAvatar" :user="metadata.avatar" indicator/>
11+
<div v-if="metadata.avatar" :class="$style.titleAvatarContainer">
12+
<MkAvatar :class="$style.titleAvatar" :user="metadata.avatar" indicator/>
13+
</div>
1214
<i v-else-if="metadata.icon" :class="[$style.titleIcon, metadata.icon]"></i>
1315

1416
<div :class="$style.title">
@@ -249,13 +251,19 @@ onUnmounted(() => {
249251
margin-left: 24px;
250252
}
251253
252-
.titleAvatar {
254+
.titleAvatarContainer {
253255
$size: 32px;
254-
display: inline-block;
256+
contain: strict;
257+
overflow: clip;
255258
width: $size;
256259
height: $size;
257-
vertical-align: bottom;
258-
margin: 0 8px;
260+
padding: 8px;
261+
flex-shrink: 0;
262+
}
263+
264+
.titleAvatar {
265+
width: 100%;
266+
height: 100%;
259267
pointer-events: none;
260268
}
261269

0 commit comments

Comments
 (0)