From 1edce5cc8e69791c37a033b47f607b20e643454c Mon Sep 17 00:00:00 2001 From: nitin mohan Date: Sat, 25 Jul 2026 08:43:32 +0530 Subject: [PATCH] fixed dashboard card animation bug --- components/dashboard/auth-overlay.tsx | 61 +++++++++++++++------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/components/dashboard/auth-overlay.tsx b/components/dashboard/auth-overlay.tsx index 2c341f3..c4ae81f 100644 --- a/components/dashboard/auth-overlay.tsx +++ b/components/dashboard/auth-overlay.tsx @@ -29,43 +29,50 @@ export function DashboardAuthOverlay({ const containerRef = useRef(null); const { scrollYProgress } = useScroll({ target: containerRef, - offset: ["start 45%", "start 10%"], + offset: ["start 90%", "start 10%"], }); - // Snappy, premium spring (PhonePe style) + // Tuned spring — fast attack, no oscillation, buttery smooth const smoothProgress = useSpring(scrollYProgress, { - stiffness: 300, - damping: 30, - restDelta: 0.001, + stiffness: 180, + damping: 28, + restDelta: 0.0001, }); // Drop down from slightly above, scale up, and fold in 3D - const scale = useTransform(smoothProgress, [0, 1], [0.6, 1]); - const y = useTransform(smoothProgress, [0, 1], [-60, 0]); - const rotateX = useTransform(smoothProgress, [0, 1], [15, 0]); + const scale = useTransform(smoothProgress, [0, 1], [0.7, 1]); + const y = useTransform(smoothProgress, [0, 1], [-40, 0]); + const rotateX = useTransform(smoothProgress, [0, 1], [12, 0]); const opacity = useTransform(smoothProgress, [0, 1], [0, 1]); return ( - - {/* Frosted Backdrop — covers dashboard section */} + + {/* Frosted Backdrop — GPU-promoted layer for smooth opacity */} - {/* Fixed Card Container — viewport-pinned so it never scrolls away */} - + {/* Wrapper: Sticky scrolling on Mobile, Static absolute centering on Desktop */} +
- {/* Floating Card - Scale, Opacity, Y, and 3D Rotate linked to smooth scroll */} + {/* Floating Card — GPU-composited transforms for zero-lag scroll */} {/* Light Mode Ambient Background Mesh */}
@@ -86,9 +93,9 @@ export function DashboardAuthOverlay({ {/* Floating Glowing Lock Header */}
-
+
); }