From 9dce512fbb231666ae35dcf3ab4c2bf2062d3303 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Mon, 10 Mar 2025 15:47:00 +0900
Subject: [PATCH] enhance(frontend): add navbar transition animation
---
packages/frontend/src/ui/_common_/navbar.vue | 22 +++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue
index bd5e0bba8a..234972e76d 100644
--- a/packages/frontend/src/ui/_common_/navbar.vue
+++ b/packages/frontend/src/ui/_common_/navbar.vue
@@ -9,12 +9,12 @@ SPDX-License-Identifier: AGPL-3.0-only
- {{ i18n.ts.timeline }}
+ {{ i18n.ts.timeline }}
@@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:to="navbarItemDef[item].to"
v-on="navbarItemDef[item].action ? { click: navbarItemDef[item].action } : {}"
>
- {{ navbarItemDef[item].title }}
+ {{ navbarItemDef[item].title }}
{{ navbarItemDef[item].indicateValue }}
@@ -37,14 +37,14 @@ SPDX-License-Identifier: AGPL-3.0-only
- {{ i18n.ts.controlPanel }}
+ {{ i18n.ts.controlPanel }}
- {{ i18n.ts.settings }}
+ {{ i18n.ts.settings }}
@@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.note }}
@@ -128,7 +128,13 @@ watch(store.r.menuDisplay, () => {
});
function toggleIconOnly() {
- store.set('menuDisplay', iconOnly.value ? 'sideFull' : 'sideIcon');
+ if (document.startViewTransition && prefer.s.animation) {
+ document.startViewTransition(() => {
+ store.set('menuDisplay', iconOnly.value ? 'sideFull' : 'sideIcon');
+ });
+ } else {
+ store.set('menuDisplay', iconOnly.value ? 'sideFull' : 'sideIcon');
+ }
}
function openAccountMenu(ev: MouseEvent) {