From 0b5a590481c536d3a60ba5c3506035ce8e2361e9 Mon Sep 17 00:00:00 2001 From: nitin mohan Date: Mon, 20 Jul 2026 21:54:23 +0530 Subject: [PATCH] added dashboard card revelling animation --- app/dashboard/page.tsx | 38 ++++----------------- components/dashboard/auth-overlay.tsx | 49 ++++++++++++++++++--------- 2 files changed, 39 insertions(+), 48 deletions(-) diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 43e0325..f8ca686 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -62,13 +62,7 @@ export default function DashboardPage() {
{/* 1. Premium Welcome Banner (Full Width) */} - +
{/* Ambient Background Glow (Dark Mode only) */}
@@ -160,21 +154,11 @@ export default function DashboardPage() {
-
+
{/* 2. Continue Learning Section (Left side) */} - +

Start your journey @@ -212,20 +196,10 @@ export default function DashboardPage() { isPreviewing={isPreviewing} />

- +
{/* 3. Quick Actions (Right side grid) */} - +

Quick Actions @@ -265,7 +239,7 @@ export default function DashboardPage() { isPreviewing={isPreviewing} />

- +
diff --git a/components/dashboard/auth-overlay.tsx b/components/dashboard/auth-overlay.tsx index 3486f19..672f2cf 100644 --- a/components/dashboard/auth-overlay.tsx +++ b/components/dashboard/auth-overlay.tsx @@ -1,7 +1,8 @@ "use client"; import Link from "next/link"; -import { motion } from "framer-motion"; +import { useRef } from "react"; +import { motion, useScroll, useTransform, useSpring } from "framer-motion"; import { Lock, UserPlus, @@ -25,26 +26,42 @@ export function DashboardAuthOverlay({ }: { onPreview?: () => void; }) { + const containerRef = useRef(null); + const { scrollYProgress } = useScroll({ + target: containerRef, + offset: ["start 90%", "start 10%"], + }); + + // Snappy, premium spring (PhonePe style) + const smoothProgress = useSpring(scrollYProgress, { + stiffness: 300, + damping: 30, + restDelta: 0.001, + }); + + // 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 opacity = useTransform(smoothProgress, [0, 1], [0, 1]); + return ( - - {/* Frosted Backdrop — lighter blur so dashboard content is recognizable */} -
+ + {/* Frosted Backdrop — opacity linked to scroll */} + {/* Wrapper: Sticky scrolling on Mobile, Static absolute centering on Desktop */}
-
- {/* Floating Card */} +
+ {/* Floating Card - Scale, Opacity, Y, and 3D Rotate linked to smooth scroll */} {/* Top Gradient Accent Line */}