diff --git a/src/app/generate/GeneratePageClient.tsx b/src/app/generate/GeneratePageClient.tsx index 40ab6f9..a857644 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 && } + +
+
); diff --git a/src/app/generate/[repo]/page.tsx b/src/app/generate/[repo]/page.tsx index e388230..f272df6 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..4335425 --- /dev/null +++ b/src/components/Generator/LoadingOverlay.tsx @@ -0,0 +1,106 @@ +"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 +
+
+
+ +