summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-30 08:49:14 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-30 08:49:14 +0900
commita420a95fae7afba06b39198253605de9701fdde1 (patch)
tree058758c2513d4d2e68d8f7a3e9a4765e9b618421 /packages/frontend/src
parentfix(deps): update dependency vite to v6.2.3 [security] (#15710) (diff)
downloadmisskey-a420a95fae7afba06b39198253605de9701fdde1.tar.gz
misskey-a420a95fae7afba06b39198253605de9701fdde1.tar.bz2
misskey-a420a95fae7afba06b39198253605de9701fdde1.zip
perf(frontend): アニメーション無効時のパフォーマンスを向上
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkReactionsViewer.vue16
-rw-r--r--packages/frontend/src/components/MkTooltip.vue3
-rw-r--r--packages/frontend/src/ui/_common_/common.vue17
3 files changed, 20 insertions, 16 deletions
diff --git a/packages/frontend/src/components/MkReactionsViewer.vue b/packages/frontend/src/components/MkReactionsViewer.vue
index ac4f4acdbb..6e23709be4 100644
--- a/packages/frontend/src/components/MkReactionsViewer.vue
+++ b/packages/frontend/src/components/MkReactionsViewer.vue
@@ -4,22 +4,24 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<TransitionGroup
- :enterActiveClass="prefer.s.animation ? $style.transition_x_enterActive : ''"
- :leaveActiveClass="prefer.s.animation ? $style.transition_x_leaveActive : ''"
- :enterFromClass="prefer.s.animation ? $style.transition_x_enterFrom : ''"
- :leaveToClass="prefer.s.animation ? $style.transition_x_leaveTo : ''"
- :moveClass="prefer.s.animation ? $style.transition_x_move : ''"
+<component
+ :is="prefer.s.animation ? TransitionGroup : 'div'"
+ :enterActiveClass="$style.transition_x_enterActive"
+ :leaveActiveClass="$style.transition_x_leaveActive"
+ :enterFromClass="$style.transition_x_enterFrom"
+ :leaveToClass="$style.transition_x_leaveTo"
+ :moveClass="$style.transition_x_move"
tag="div" :class="$style.root"
>
<XReaction v-for="[reaction, count] in reactions" :key="reaction" :reaction="reaction" :count="count" :isInitial="initialReactions.has(reaction)" :note="note" @reactionToggled="onMockToggleReaction"/>
<slot v-if="hasMoreReactions" name="more"/>
-</TransitionGroup>
+</component>
</template>
<script lang="ts" setup>
import * as Misskey from 'misskey-js';
import { inject, watch, ref } from 'vue';
+import { TransitionGroup } from 'vue';
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
import { prefer } from '@/preferences.js';
import { DI } from '@/di.js';
diff --git a/packages/frontend/src/components/MkTooltip.vue b/packages/frontend/src/components/MkTooltip.vue
index ddfa6def87..3fe80f4ab4 100644
--- a/packages/frontend/src/components/MkTooltip.vue
+++ b/packages/frontend/src/components/MkTooltip.vue
@@ -9,7 +9,8 @@ SPDX-License-Identifier: AGPL-3.0-only
:leaveActiveClass="prefer.s.animation ? $style.transition_tooltip_leaveActive : ''"
:enterFromClass="prefer.s.animation ? $style.transition_tooltip_enterFrom : ''"
:leaveToClass="prefer.s.animation ? $style.transition_tooltip_leaveTo : ''"
- appear @afterLeave="emit('closed')"
+ appear :css="prefer.s.animation"
+ @afterLeave="emit('closed')"
>
<div v-show="showing" ref="el" :class="$style.root" class="_acrylic _shadow" :style="{ zIndex, maxWidth: maxWidth + 'px' }">
<slot>
diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue
index 930f633c9f..9ee3e3af37 100644
--- a/packages/frontend/src/ui/_common_/common.vue
+++ b/packages/frontend/src/ui/_common_/common.vue
@@ -14,7 +14,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<XUpload v-if="uploads.length > 0"/>
-<TransitionGroup
+<component
+ :is="prefer.s.animation ? TransitionGroup : 'div'"
tag="div"
:class="[$style.notifications, {
[$style.notificationsPosition_leftTop]: prefer.s.notificationPosition === 'leftTop',
@@ -24,16 +25,16 @@ SPDX-License-Identifier: AGPL-3.0-only
[$style.notificationsStackAxis_vertical]: prefer.s.notificationStackAxis === 'vertical',
[$style.notificationsStackAxis_horizontal]: prefer.s.notificationStackAxis === 'horizontal',
}]"
- :moveClass="prefer.s.animation ? $style.transition_notification_move : ''"
- :enterActiveClass="prefer.s.animation ? $style.transition_notification_enterActive : ''"
- :leaveActiveClass="prefer.s.animation ? $style.transition_notification_leaveActive : ''"
- :enterFromClass="prefer.s.animation ? $style.transition_notification_enterFrom : ''"
- :leaveToClass="prefer.s.animation ? $style.transition_notification_leaveTo : ''"
+ :moveClass="$style.transition_notification_move"
+ :enterActiveClass="$style.transition_notification_enterActive"
+ :leaveActiveClass="$style.transition_notification_leaveActive"
+ :enterFromClass="$style.transition_notification_enterFrom"
+ :leaveToClass="$style.transition_notification_leaveTo"
>
<div v-for="notification in notifications" :key="notification.id" :class="$style.notification">
<XNotification :notification="notification"/>
</div>
-</TransitionGroup>
+</component>
<XStreamIndicator/>
@@ -45,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { defineAsyncComponent, ref } from 'vue';
+import { defineAsyncComponent, ref, TransitionGroup } from 'vue';
import * as Misskey from 'misskey-js';
import { swInject } from './sw-inject.js';
import XNotification from './notification.vue';