From ebeda5e74cbccb21f3cc51b3fc3138432839e0ee Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Fri, 5 Jun 2026 18:57:58 +0530 Subject: [PATCH] feat: add premium loading screen --- src/App.tsx | 23 +++++++++++++- src/components/LoadingScreen.tsx | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/components/LoadingScreen.tsx diff --git a/src/App.tsx b/src/App.tsx index e9c0b9e..78e2dc1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,3 +1,4 @@ +import React, { useState, useEffect } from 'react'; import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { ThemeProvider } from './context/ThemeContext'; import { Toaster } from 'react-hot-toast'; @@ -18,12 +19,32 @@ import PrivacyPolicy from './pages/Privacypolicy'; import Termsandconditions from './pages/termsandconditions'; import ContactPage from './pages/ContactPage'; import NotFound from './pages/NotFound'; +import { LoadingScreen } from './components/LoadingScreen'; +function App() { + const [isLoading, setIsLoading] = useState(true); + const [isFading, setIsFading] = useState(false); + useEffect(() => { + // Start fading out after 600ms + const fadeTimer = setTimeout(() => { + setIsFading(true); + }, 600); + + // Completely remove from DOM after 1000ms + const removeTimer = setTimeout(() => { + setIsLoading(false); + }, 1000); + + return () => { + clearTimeout(fadeTimer); + clearTimeout(removeTimer); + }; + }, []); -function App() { return ( + {isLoading && } {/* // Global back-to-top button available across all pages */} diff --git a/src/components/LoadingScreen.tsx b/src/components/LoadingScreen.tsx new file mode 100644 index 0000000..4b43df8 --- /dev/null +++ b/src/components/LoadingScreen.tsx @@ -0,0 +1,52 @@ +import React from 'react'; +import { Heart, Loader2 } from 'lucide-react'; + +interface LoadingScreenProps { + isFading: boolean; +} + +export function LoadingScreen({ isFading }: LoadingScreenProps) { + return ( +
+ + +
+ {/* Subtle Glow effect behind logo */} +
+ + {/* Premium subtle scale/pulse container (removed bounce) */} +
+ +
+ +

+ SafeVoice +

+ + {/* Tagline */} +

+ Your story. Your strength. +

+ + {/* Minimal Spinner */} +
+ +
+
+
+ ); +}