feat(ui): add smooth mount animation for route transitions

This commit is contained in:
xfy 2026-07-03 17:21:04 +08:00
parent 197c08d258
commit d361bca220
2 changed files with 21 additions and 2 deletions

View File

@ -44,6 +44,21 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@keyframes page-enter {
0% {
opacity: 0;
transform: translateY(16px) scale(0.995);
}
100% {
opacity: 1;
transform: none;
}
}
.animate-page-enter {
animation: page-enter 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Minimalist custom scrollbars */ /* Minimalist custom scrollbars */
* { * {
scrollbar-width: thin; scrollbar-width: thin;

View File

@ -59,8 +59,12 @@ pub fn FrontendLayout() -> Element {
ThemeToggle {} ThemeToggle {}
}, },
} }
main { class: "flex-1 w-full max-w-4xl mx-auto px-6 py-6 md:py-12", main { class: "flex-1 w-full max-w-4xl mx-auto px-6 py-6 md:py-12 overflow-hidden",
SuspenseBoundary { fallback: move |_| route_skeleton(&route), Outlet::<Route> {} } div {
key: "{route}",
class: "animate-page-enter",
SuspenseBoundary { fallback: move |_| route_skeleton(&route), Outlet::<Route> {} }
}
} }
Footer {} Footer {}
} }