-
Notifications
You must be signed in to change notification settings - Fork 2
Add LoadingOverlay and integrate into Generate page #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <div className="fixed inset-0 z-100 flex flex-col items-center justify-center bg-[#050505] font-mono"> | ||
naheel0 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {/* BACKGROUND GRID EFFECT */} | ||
| <div | ||
| className="absolute inset-0 opacity-10" | ||
| style={{ | ||
| backgroundImage: | ||
| "linear-gradient(#333 1px, transparent 1px), linear-gradient(90deg, #333 1px, transparent 1px)", | ||
| backgroundSize: "40px 40px", | ||
| }} | ||
| ></div> | ||
|
|
||
| {/* RING CONTAINER */} | ||
| <div className="relative flex h-64 w-64 items-center justify-center"> | ||
| {/* Chromatic Orbiting Rings */} | ||
| <div className="absolute h-36 w-36 rounded-full border border-red-500/40 mix-blend-screen blur-[2px] animate-[ring-pulse_4s_linear_infinite] scale-110"></div> | ||
| <div className="absolute h-36 w-36 rounded-full border border-emerald-400/40 mix-blend-screen blur-[2px] animate-[ring-pulse_4s_linear_infinite_1s] scale-105"></div> | ||
| <div className="absolute h-36 w-36 rounded-full border border-indigo-500/40 mix-blend-screen blur-[2px] animate-[ring-pulse_4s_linear_infinite_2s] scale-110"></div> | ||
|
|
||
| {/* Technical Inner Ring */} | ||
| <div className="absolute h-28 w-28 rounded-full border border-dashed border-white/20 animate-spin-slow"></div> | ||
|
|
||
| {/* Core White Ring */} | ||
| <div className="absolute h-32 w-32 rounded-full border-2 border-white shadow-[0_0_30px_rgba(255,255,255,0.2)] animate-[ring-pulse_3s_ease-in-out_infinite]"></div> | ||
|
|
||
| {/* Binary Data Bits (Decorative) */} | ||
| <div className="absolute inset-0 flex items-center justify-center opacity-40 text-[8px] text-emerald-500 pointer-events-none"> | ||
| <div className="animate-pulse">01011001</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* CODING VIBE TEXT ELEMENTS */} | ||
| <div className="mt-8 flex flex-col items-center gap-4 z-10"> | ||
| <div className="flex flex-col items-center"> | ||
| <p className="text-xs tracking-[0.5em] text-zinc-500 uppercase mb-1"> | ||
| System Status | ||
| </p> | ||
| <div className="flex items-baseline gap-2"> | ||
| <span className="h-2 w-2 rounded-full bg-emerald-500 animate-pulse"></span> | ||
| <p className="text-xl font-bold tracking-tighter text-white"> | ||
| {terminalText} | ||
| <span className="animate-bounce">_</span> | ||
| </p> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* DATA METRICS FOOTER */} | ||
| <div className="mt-4 grid grid-cols-3 gap-8 text-[10px] text-zinc-600 border-t border-zinc-800 pt-4 uppercase tracking-widest"> | ||
| <div className="flex flex-col items-center"> | ||
| <span>CPU</span> | ||
| <span className="text-emerald-400">88.4%</span> | ||
| </div> | ||
| <div className="flex flex-col items-center border-x border-zinc-800 px-8"> | ||
| <span>MEM</span> | ||
| <span className="text-indigo-400">12GB</span> | ||
| </div> | ||
| <div className="flex flex-col items-center"> | ||
| <span>PING</span> | ||
| <span className="text-red-400">14MS</span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <style | ||
| dangerouslySetInnerHTML={{ | ||
| __html: ` | ||
| @keyframes ring-pulse { | ||
| 0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; } | ||
| 50% { transform: scale(1.1) rotate(180deg); opacity: 0.7; } | ||
| } | ||
| .animate-spin-slow { | ||
| animation: spin 10s linear infinite; | ||
| } | ||
| @keyframes spin { | ||
| from { transform: rotate(0deg); } | ||
| to { transform: rotate(360deg); } | ||
| } | ||
| .mix-blend-screen { | ||
| mix-blend-mode: screen; | ||
| } | ||
| `, | ||
| }} | ||
| /> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default LoadingOverlay; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.