From 06e8400fb6e4c883f30c7bc52c4cb230a317729d Mon Sep 17 00:00:00 2001 From: Abiram070207 Date: Thu, 25 Jun 2026 05:54:55 +0530 Subject: [PATCH] design: use clipPath polygon interpolation to animate splash screen exit seamlessly --- frontend/src/App.tsx | 141 ++++++++++++++++++++----------- frontend/src/pages/LoginPage.tsx | 39 +++++---- 2 files changed, 113 insertions(+), 67 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 113cdea..08e3419 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -13,6 +13,7 @@ import { DialogProvider } from './context/DialogContext'; import { motion, AnimatePresence } from 'framer-motion'; import { StatusTimeline, type Event } from './components/dashboard/EventStatusTimeline'; import { useEffect } from 'react'; +import ritLogo from './assets/images/college-logo.png'; import { InstitutionalCalendar } from './components/dashboard/InstitutionalCalendar'; import { VenueTimeline } from './components/dashboard/VenueTimeline'; @@ -27,6 +28,56 @@ import { ManageNoticesView } from './components/dashboard/ManageNoticesView'; import { ManageStudentsView } from './components/dashboard/ManageStudentsView'; import { VenueManagement } from './components/dashboard/VenueManagement'; +const LoginTransitionScreen: React.FC<{ user: any }> = ({ user }) => { + return ( + +
+ + RIT Logo + + +
+ + Welcome Back + + + {user?.fullName || "User"} + +
+ + + Connecting to Event Hub... + +
+
+ ); +}; const AppContent: React.FC = () => { const { isAuthenticated, user } = useAuth(); @@ -34,6 +85,22 @@ const AppContent: React.FC = () => { const [activeItem, setActiveItem] = useState('dashboard'); const [userEvents, setUserEvents] = useState([]); const [preFillData, setPreFillData] = useState(null); + const [showTransition, setShowTransition] = useState(false); + const [cachedUser, setCachedUser] = useState(null); + + useEffect(() => { + if (isAuthenticated && user) { + setCachedUser(user); + setShowTransition(true); + const timer = setTimeout(() => { + setShowTransition(false); + }, 2000); + return () => clearTimeout(timer); + } else { + setShowTransition(false); + setCachedUser(null); + } + }, [isAuthenticated, user]); const handleIncompleteClick = (data: any) => { setPreFillData(data); @@ -101,38 +168,6 @@ const AppContent: React.FC = () => { } }, [isAuthenticated, activeItem, user?.email, user?.role, user?.department]); - if (!isAuthenticated) { - return ( - - - - - - ); - } - - if (user?.role === 'STUDENT') { - return ( - - - - - - ); - } - const renderContent = () => { const isDashboard = ( { }; return ( - - - - {renderContent()} - + <> + + {showTransition && } - + + {!isAuthenticated ? ( + + ) : user?.role === 'STUDENT' ? ( + + ) : ( + + + + {renderContent()} + + + + )} + ); }; diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index 58ab011..93aa1e6 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -39,6 +39,13 @@ export const LoginPage: React.FC = () => { const [isSignUp, setIsSignUp] = useState(false); const [signUpType, setSignUpType] = useState<'INTERNAL' | 'EXTERNAL' | null>(null); const [splashState, setSplashState] = useState<'logo' | 'text' | 'fade-to-white' | 'done'>('logo'); + const [isMobile, setIsMobile] = useState(typeof window !== 'undefined' ? window.innerWidth < 1024 : false); + + useEffect(() => { + const handleResize = () => setIsMobile(window.innerWidth < 1024); + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); useEffect(() => { const timer1 = setTimeout(() => { @@ -623,25 +630,17 @@ export const LoginPage: React.FC = () => { {/* Splash Screen Overlay */} {splashState !== 'done' && ( -
- {/* Left part of splash: remains static blue on desktop to match underlying panel */} - - - {/* Right part of splash (and full screen on mobile): slides right to reveal white page */} - - + {/* Centered content overlay for Logo/Text */}
@@ -674,7 +673,7 @@ export const LoginPage: React.FC = () => { )}
-
+ )}