From b2a78ee8369dd26fbcf6303673fffae134b53782 Mon Sep 17 00:00:00 2001 From: Naheel Muhammed Date: Mon, 16 Feb 2026 21:46:35 +0530 Subject: [PATCH 1/2] Add LoadingOverlay and integrate into Generate page Introduce a new LoadingOverlay client component (complex animated UI with rings, terminal text, and metrics) and wire it into GeneratePageClient to render when isLoading is true. Also import TerminalMockup into the page and adjust container to relative to allow overlay stacking. Minor safe-change in src/app/generate/[repo]/page.tsx: update repoDisplayName extraction to use slice(-1)[0] ?? repoName for safer splitting. Co-Authored-By: jaseel0 <225665919+jaseel0@users.noreply.github.com> --- src/app/generate/GeneratePageClient.tsx | 15 +++- src/app/generate/[repo]/page.tsx | 4 +- src/components/Generator/LoadingOverlay.tsx | 96 +++++++++++++++++++++ 3 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 src/components/Generator/LoadingOverlay.tsx diff --git a/src/app/generate/GeneratePageClient.tsx b/src/app/generate/GeneratePageClient.tsx index 40ab6f9..3cf0748 100644 --- a/src/app/generate/GeneratePageClient.tsx +++ b/src/app/generate/GeneratePageClient.tsx @@ -4,10 +4,12 @@ import { Navbar } from "@/components/layout/Navbar"; import { Footer } from "@/components/layout/Footer"; import { SearchInput } from "@/components/Generator/SearchInput"; import { MarkdownPreview } from "@/components/Generator/MarkdownPreview"; +import { LoadingOverlay } from "@/components/Generator/LoadingOverlay"; import { navLinks } from "@/constants/navLinks"; +import { TerminalMockup } from "@/components/sections/TerminalMockup"; interface GeneratePageProps { - repoSlug?: string; // Optional pre-filled repo from server-side route + repoSlug?: string; } export default function GeneratePageClient({ repoSlug }: GeneratePageProps) { @@ -66,8 +68,14 @@ export default function GeneratePageClient({ repoSlug }: GeneratePageProps) { }; return ( -
+
+ {/* UI LOADING OVERLAY + Renders on top of everything when isLoading is true + */} + {isLoading && } + +
+
); -} +} \ No newline at end of file diff --git a/src/app/generate/[repo]/page.tsx b/src/app/generate/[repo]/page.tsx index e388230..f3205ff 100644 --- a/src/app/generate/[repo]/page.tsx +++ b/src/app/generate/[repo]/page.tsx @@ -12,8 +12,8 @@ export async function generateMetadata({ params, }: PageProps): Promise { const resolvedParams = await params; - const repoName = resolvedParams.repo; // full repo slug like "facebook/react" - const repoDisplayName = repoName.split("/").pop(); // e.g., "react" + const repoName = resolvedParams.repo; + const repoDisplayName = repoName.split("/").slice(-1)[0] ?? repoName; return { title: `AI-Generated README for ${repoDisplayName} | ReadmeGenAI`, diff --git a/src/components/Generator/LoadingOverlay.tsx b/src/components/Generator/LoadingOverlay.tsx new file mode 100644 index 0000000..3017e1b --- /dev/null +++ b/src/components/Generator/LoadingOverlay.tsx @@ -0,0 +1,96 @@ +"use client"; + +import React, { useState, useEffect } from 'react'; + +export const LoadingOverlay = () => { + const [terminalText, setTerminalText] = useState(""); + const fullText = "INITIALIZING_NEURAL_ENGINE... [OK]"; + + useEffect(() => { + let i = 0; + const interval = setInterval(() => { + setTerminalText(fullText.slice(0, i)); + i++; + if (i > fullText.length) i = 0; + }, 100); + return () => clearInterval(interval); + }, []); + + return ( +
+ {/* BACKGROUND GRID EFFECT */} +
+
+ + {/* RING CONTAINER */} +
+ {/* Chromatic Orbiting Rings */} +
+
+
+ + {/* Technical Inner Ring */} +
+ + {/* Core White Ring */} +
+ + {/* Binary Data Bits (Decorative) */} +
+
01011001
+
+
+ + {/* CODING VIBE TEXT ELEMENTS */} +
+
+

+ System Status +

+
+ +

+ {terminalText}_ +

+
+
+ + {/* DATA METRICS FOOTER */} +
+
+ CPU + 88.4% +
+
+ MEM + 12GB +
+
+ PING + 14MS +
+
+
+ +