fix: 修复页面过渡动画导致 fixed 定位失效和全局徽章被遮挡
This commit is contained in:
+1
-1
@@ -40,8 +40,8 @@ export default function RootLayout({
|
|||||||
</head>
|
</head>
|
||||||
<body className={`${geistSans.variable} font-sans antialiased`}>
|
<body className={`${geistSans.variable} font-sans antialiased`}>
|
||||||
<ServiceWorkerRegistrar />
|
<ServiceWorkerRegistrar />
|
||||||
<GlobalUserBadge />
|
|
||||||
<PageTransition>{children}</PageTransition>
|
<PageTransition>{children}</PageTransition>
|
||||||
|
<GlobalUserBadge />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function GlobalUserBadge() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<motion.div
|
<motion.div
|
||||||
className="fixed right-4 top-3 z-40 flex items-center gap-1.5"
|
className="fixed right-4 top-3 z-50 flex items-center gap-1.5"
|
||||||
initial={{ opacity: 0, scale: 0.9 }}
|
initial={{ opacity: 0, scale: 0.9 }}
|
||||||
animate={{ opacity: 1, scale: 1 }}
|
animate={{ opacity: 1, scale: 1 }}
|
||||||
transition={{ delay: 0.1, duration: 0.3 }}
|
transition={{ delay: 0.1, duration: 0.3 }}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ function FrozenRoute({ children }: PropsWithChildren) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const variants = {
|
const variants = {
|
||||||
enter: { opacity: 0, y: 12 },
|
enter: { opacity: 0 },
|
||||||
center: { opacity: 1, y: 0 },
|
center: { opacity: 1 },
|
||||||
exit: { opacity: 0, y: -12 },
|
exit: { opacity: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function PageTransition({ children }: PropsWithChildren) {
|
export default function PageTransition({ children }: PropsWithChildren) {
|
||||||
|
|||||||
Reference in New Issue
Block a user