From ca3ae0db6e8e3f2cf99423797c60f5c2cc66a780 Mon Sep 17 00:00:00 2001 From: Biswa Kalyan Bhuyan Date: Thu, 29 May 2025 20:57:31 +0530 Subject: feat: added the product page and enhanced the UI - added the product page where the product details is shown - enhanced the nav bar to handle the rendering - added the loading screen to the page - fixed the rendering method to the navigation-menu --- frontend/src/components/loading.tsx | 111 ++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 frontend/src/components/loading.tsx (limited to 'frontend/src/components/loading.tsx') diff --git a/frontend/src/components/loading.tsx b/frontend/src/components/loading.tsx new file mode 100644 index 0000000..cbd5c15 --- /dev/null +++ b/frontend/src/components/loading.tsx @@ -0,0 +1,111 @@ +"use client"; + +import { useEffect, useState } from "react"; +import Image from "next/image"; + +export function LoadingScreen() { + const [isVisible, setIsVisible] = useState(true); + + useEffect(() => { + // Hide loading screen after a short delay to ensure everything is ready + const timer = setTimeout(() => { + setIsVisible(false); + }, 1000); + + return () => clearTimeout(timer); + }, []); + + if (!isVisible) return null; + + return ( +
+ {/* Background pattern */} +
+ + {/* Loading content */} +
+ {/* Logo with animation */} +
+
+ blcklst + blcklst +
+
+ + {/* Loading text - closer to logo */} +
+

+ not everyone gets blcklsted +

+ + {/* Loading dots */} +
+
+
+
+
+
+ + {/* Progress bar */} +
+
+
+
+
+ ); +} + +export function PageWrapper({ children }: { children: React.ReactNode }) { + const [isLoading, setIsLoading] = useState(true); + const [showContent, setShowContent] = useState(false); + + useEffect(() => { + // Check if page is ready + const checkReady = () => { + if (document.readyState === 'complete') { + setTimeout(() => { + setIsLoading(false); + setTimeout(() => setShowContent(true), 100); + }, 800); + } + }; + + if (document.readyState === 'complete') { + checkReady(); + } else { + window.addEventListener('load', checkReady); + } + + return () => { + window.removeEventListener('load', checkReady); + }; + }, []); + + return ( + <> + {isLoading && } +
+ {children} +
+ + ); +} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b