1. Analyze the Request:
* Goal: Create a developer portal MVP.
* Key Features: Catalog (API/SDK list), Golden Paths (tutorials, common workflows), Templates (starter code), Scaffolding (CLI/Codesandbox generation).
* Role: 2077 FUI design expert. Cyberpunk/Hard Sci-Fi style.
* Constraints: Dark mode, neon, monospace, intricate structure, dynamic/active elements, Tailwind, Canvas/Three.js allowed, glitch effects.
* Output: A single HTML file (implied, as it's a "create... portal" usually resulting in a web page).
-
Conceptualization & Design:
- Theme: "System Access: Developer Nexus." The portal is a HUD for developers.
- Layout: A fixed HUD-like frame with a central view area.
- Top bar: Status, Credits, System Time (glitchy).
- Left sidebar: Navigation (Catalog, Paths, Templates, Scaffold). This needs to be an active data stream or wireframe list.
- Main Content: The dynamic area. It will switch based on the nav selection.
- Right panel: Possibly a terminal output or "scaffolding status" window to satisfy the "dynamic" requirement.
- Bottom: Progress bars, network traffic, scanning lines.
- Visuals: Cyan/Teal as primary neon color. Dark blue/black background. Hairlines (1px borders). Monospaced font (JetBrains Mono or similar).
- Interactivity: Clicking nav items changes the main view with a "glitch" transition. Buttons have hover states (cursor changes, border pulses). The Scaffolding button triggers a "decoding" text effect and a simulated generation process.
-
Implementation Strategy:
- Skeleton: Single HTML file.
- Libraries:
- Tailwind CSS (via CDN).
- Google Fonts: 'JetBrains Mono'.
- Custom CSS for animations (keyframes for glitch, scanlines, cursor blinking, neon glow).
- Structure (HTML):
body: bg-slate-900 (custom dark) with a grid layout.
#hud-frame: Absolute borders covering viewport.
#sidebar: List of modules.
#main-view: Container for the 4 sections (catalog, paths, templates, scaffold).
#terminal-overlay: Fixed bottom-right or part of layout to show logs.
- JavaScript Logic:
- State Management: Simple variable
currentTab.
- Navigation: Event listeners on sidebar items to hide/show sections.
- Scaffolding Simulation: When the "Generate" button is clicked (in the Scaffold section), show a loading bar, simulate terminal commands (maybe using a typewriter effect), and finally present a success modal or download link.
- Glitch Effect: Randomly apply CSS classes or manipulate text content for visual noise.
-
Developing Specific Sections:
- Catalog: A grid of cards. Each card represents an API/SDK. Needs a "Connect" button that triggers a "handshake" animation (maybe a rotating ring). Data: "NeuralNet API", "Quantum Storage", "Hologram Renderer".
- Golden Paths: Step-by-step vertical timeline. Vertical lines connecting nodes. Clicking a node expands details. "Deploy First Agent", "Set Up Payment Rail".
- Templates: Code snippet previews with a "Copy to Clipboard" button that shows a "COPIED" flash.
- Scaffolding: A form to select project type (React, Vue, Static). A big "EXECUTE SCaffold" button. On click -> "Initializing environment... [####....]" -> "Build complete." -> Show a mock "Download .zip" link.
-
Adding Cyberpunk Polish (FUI Details):
- Scanline overlay: A repeating linear gradient with low opacity.
- Corner Brackets: Use pseudo-elements (
::before, ::after) on containers to draw decorative L-shapes.
- Text Glitch: Use a CSS animation that translates the text slightly and clips it with
clip-path or opacity shifts. Or simpler: JS random character replacement during hover/load (decoding effect).
- Canvas: Let's add a small canvas in the background or a specific "System Monitor" widget drawing a wireframe globe or rotating radar. It adds the "Three.js" feel without overcomplicating (keeping it MVP but flashy). I'll put a canvas in the "System Status" panel showing a rotating wireframe sphere.
-
Coding - Step-by-Step Draft:
- Setup: HTML5 boilerplate, Tailwind script, Font link.
- Custom CSS: Define
@keyframes scan, @keyframes spin, @keyframes glitch, @keyframes blink. Define colors: --neon-cyan: #00f3ff;.
- Layout: Flexbox/Grid.
- Sidebar: Vertical list. Each item has an icon (using SVG) and text.
- Main:
#catalog-view: Grid of cards using Tailwind grid-cols-2. Cards have borders, hover glow.
#paths-view: Flex column with timeline border.
#templates-view: List of syntax-highlighted code blocks (styled divs).
#scaffold-view: Form (selects, inputs) with a "Terminal" output div for the simulation.
-
Refining Interactions (JavaScript):
- Tab Switching:
document.querySelectorAll('.nav-item').forEach(...). Add active class styling (glowing border-left).
- Decoding Text: A function
typeWrite(element, text) for the terminal.
- Canvas Animation: A simple 3D point cloud sphere rotating. I'll implement a basic raw JS Canvas 3D projection to avoid heavy Three.js dependency for MVP but keep the effect. Or, simpler: a rotating wireframe dodecahedron using Canvas API
moveTo/lineTo. I'll go with a rotating wireframe sphere (dots connected) for that "Hard Sci-Fi" look.
-
Self-Correction/Review against Requirements:
- Precision structure: Added 1px borders, corner brackets, grid guides.
- Dark mode only: Slate-900 background.
- Neon glow: Tailwind
shadow-[color], CSS box-shadow.
- Monospace: Applied to all text.
- Dynamic: Canvas spinning, hover effects, glitch header.
- Catalog/Golden Paths/Templates/Scaffolding: All present.
-
Final Polish:
- Ensure the "Scaffold" feature feels substantial: show a progress bar and simulate file creation.
- Add a "glitch" effect to the page title "NEXUS PORTAL".
- Make sure the "Status" panel updates with random numbers (CPU load, network throughput) to make it feel alive.
-
Writing the Code: (This involves writing the actual HTML/CSS/JS). Mental check: Tailwind CDN is reliable. Use random seed images for avatars if needed (maybe not needed, keep it techy). Use SVG icons for folders, networks, etc.
(Self-Correction during coding): The user asked for a "Developer Portal MVP". It needs to be functional enough to demonstrate concepts. I shouldn't make it too empty. The Catalog needs dummy data. The Golden Paths need dummy steps. The Templates need dummy code snippets (e.g., a basic HTML/Express structure). The Scaffolding needs to actually "do" something visual (like print to a fake terminal).
- Final Output Generation: Combine everything into one HTML string. Ensure proper closing tags. Double-check Tailwind classes for border colors (
border-cyan-500/30). Add box-shadow: 0 0 10px #00f3ff for neon.
(Detailed Canvas Logic): To keep it lightweight but "Hard Sci-Fi", I'll draw a series of particles in a spherical distribution, rotating them around the Y-axis. Connect nearby particles with lines to create a "neural network" or "constellation" look, or just a wireframe sphere using latitude/longitude lines. I'll choose latitude/longitude wireframe for immediate recognizability as a "sys monitor globe".
Let's build it.
Plan:
- Define CSS styles for glitch, neon, scanlines.
- HTML Structure: Sidebar, Main, Terminal, Header, Footer Status.
- JS: Tab logic, Canvas loop, Decoding text, Simulated scaffolding.
Let's write the code. (Proceeding to generate the response).
Here is a complete, single-file MVP for a Cyberpunk / Hard Sci-Fi Developer Portal.
It includes:
- Catalog: A grid of API/SDK modules with "handshake" connection status.
- Golden Paths: A timeline-based tutorial interface.
- Templates: Code snippets with one-click "injection" (copy simulation).
- Scaffolding: A fully interactive CLI simulation that generates a project structure file by file.
Instructions
Save the code below as an .html file (e.g., portal.html) and open it in any modern browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NEXUS // Developer Portal</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts: JetBrains Mono -->
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
<!-- Tailwind Config for Custom Colors -->
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
mono: ['"JetBrains Mono"', 'monospace'],
},
colors: {
neon: {
cyan: '#00f3ff',
magenta: '#ff00ff',
amber: '#ffb000',
dim: 'rgba(0, 243, 255, 0.1)'
},
bg: '#050505'
},
backgroundImage: {
'scanline': 'linear-gradient(rgba(18, 16, 16, 0) 0, rgba(0, 0, 0, 0.25) 50%, rgba(18, 16, 16, 0) 0)',
'grid-pattern': 'linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px)'
}
}
}
}
</script>
<style>
/* Base Reset & Base Styles */
body {
background-color: #050505;
color: #e0e0e0;
overflow: hidden; /* App-like feel */
margin: 0;
font-family: 'JetBrains Mono', monospace;
}
/* Scrollbar Styling */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
background: #00f3ff;
border-radius: 0px;
}
/* Utilities */
.neon-border {
border: 1px solid rgba(0, 243, 255, 0.3);
box-shadow: 0 0 5px rgba(0, 243, 255, 0.1);
}
.neon-text {
text-shadow: 0 0 5px rgba(0, 243, 255, 0.7);
}
.panel-bg {
background: rgba(10, 10, 10, 0.8);
backdrop-filter: blur(5px);
}
/* Scanline Overlay (Fixed) */
.scanlines {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
background-size: 100% 4px;
pointer-events: none;
z-index: 50;
opacity: 0.6;
}
/* Corner Decorations (Pseudo Elements) */
.corner-decor::before, .corner-decor::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
border: 2px solid #00f3ff;
transition: all 0.3s ease;
}
.corner-decor::before { top: -1px; left: -1px; border-bottom: none; border-right: none; }
.corner-decor::after { bottom: -1px; right: -1px; border-top: none; border-left: none; }
/* Glitch Animation */
@keyframes glitch {
0% { transform: translate(0); }
20% { transform: translate(-2px, 2px); }
40% { transform: translate(-2px, -2px); }
60% { transform: translate(2px, 2px); }
80% { transform: translate(2px, -2px); }
100% { transform: translate(0); }
}
.glitch-hover:hover {
animation: glitch 0.3s infinite;
color: #ff00ff;
}
/* Rotating Radar */
@keyframes spin-slow {
to { transform: rotate(360deg); }
}
.spin-slow { animation: spin-slow 10s linear infinite; }
/* Flicker */
@keyframes flicker {
0% { opacity: 1; }
5% { opacity: 0.2; }
10% { opacity: 1; }
50% { opacity: 1; }
55% { opacity: 0.8; }
60% { opacity: 1; }
100% { opacity: 1; }
}
.flicker { animation: flicker 4s infinite; }
/* Data Stream (Background) */
.data-rain {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
z-index: -1;
opacity: 0.05;
pointer-events: none;
font-size: 12px;
line-height: 12px;
color: #00f3ff;
overflow: hidden;
white-space: pre;
content: attr(data-text);
}
</style>
</head>
<body class="h-screen w-screen bg-bg bg-grid-pattern bg-cover relative flex flex-col">
<!-- Scanlines -->
<div class="scanlines"></div>
<!-- Background Data Decay (Static Text) -->
<div class="data-rain font-mono opacity-5 overflow-hidden select-none pointer-events-none absolute inset-0">
01010101 01010101 01010101 01010101 01010101 01010101 01010101 01010101<br>
10010100 10101010 01010101 01010101 01010101 01010101 01010101 01010101<br>
... (repeating pattern generated via JS short script below)
</div>
<!-- Header HUD -->
<header class="h-12 border-b border-neon-cyan/30 flex items-center justify-between px-4 bg-black/50 relative z-20">
<div class="flex items-center gap-3">
<div class="w-3 h-3 bg-neon-cyan rounded-full shadow-[0_0_10px_#00f3ff] flicker"></div>
<h1 class="text-neon-cyan font-bold tracking-widest text-sm sm:text-base glitch-hover cursor-default">
NEXUS_PORTAL_V2.0.77
</h1>
</div>
<div class="flex items-center gap-6 text-xs text-neon-cyan/70 font-mono">
<div id="sys-time" class="hidden sm:block">00:00:00:00</div>
<div class="flex items-center gap-2">
<span class="w-2 h-2 bg-neon-magenta/50 rounded-full animate-pulse"></span>
<span>NET: SECURE</span>
</div>
</div>
</header>
<!-- Main Layout -->
<div class="flex flex-1 overflow-hidden relative z-10">
<!-- Sidebar Navigation -->
<nav class="w-64 border-r border-neon-cyan/30 flex flex-col bg-black/60 relative">
<div class="absolute top-0 right-0 w-[1px] h-full bg-neon-cyan/20"></div>
<div class="p-4 space-y-4 overflow-y-auto">
<div class="text-xs text-neon-cyan/50 font-bold uppercase tracking-wider mb-2">Modules</div>
<button onclick="switchTab('catalog')" id="nav-catalog" class="nav-btn w-full text-left px-3 py-2 text-sm border border-transparent hover:border-neon-cyan/50 hover:bg-neon-cyan/5 transition-all font-mono group">
<span class="block group-hover:text-neon-cyan">01 // CATALOG</span>
</button>
<button onclick="switchTab('paths')" id="nav-paths" class="nav-btn w-full text-left px-3 py-2 text-sm border border-transparent hover:border-neon-cyan/50 hover:bg-neon-cyan/5 transition-all font-mono text-neon-cyan/40">
<span>02 // GOLDEN PATHS</span>
</button>
<button onclick="switchTab('templates')" id="nav-templates" class="nav-btn w-full text-left px-3 py-2 text-sm border border-transparent hover:border-neon-cyan/50 hover:bg-neon-cyan/5 transition-all font-mono text-neon-cyan/40">
<span>03 // TEMPLATES</span>
</button>
<button onclick="switchTab('scaffold')" id="nav-scaffold" class="nav-btn w-full text-left px-3 py-2 text-sm border border-transparent hover:border-neon-cyan/50 hover:bg-neon-cyan/5 transition-all font-mono text-neon-cyan/40">
<span>04 // SCAFFOLDING</span>
</button>
</div>
<!-- Bottom Status Widget -->
<div class="mt-auto p-4 border-t border-neon-cyan/30">
<div class="text-xs text-neon-cyan/50 mb-2">SERVER LOAD</div>
<canvas id="server-load-canvas" width="200" height="40" class="w-full h-10"></canvas>
</div>
</nav>
<!-- Main Content Area -->
<main class="flex-1 relative overflow-hidden p-6 overflow-y-auto">
<!-- Decorative Corner -->
<div class="absolute top-6 right-6 w-16 h-16 border-t border-r border-neon-cyan/50 pointer-events-none"></div>
<div class="absolute bottom-6 left-6 w-16 h-16 border-b border-l border-neon-cyan/50 pointer-events-none"></div>
<!-- 1. CATALOG VIEW -->
<section id="view-catalog" class="view-section space-y-6 animate-fade-in">
<div class="flex justify-between items-end border-b border-neon-cyan/20 pb-2">
<h2 class="text-xl text-neon-cyan font-bold">Available Modules</h2>
<div class="text-xs text-neon-cyan/50 font-mono blink">UPDATED: 2.4ms AGO</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="catalog-grid">
<!-- Cards injected via JS -->
</div>
</section>
<!-- 2. GOLDEN PATHS VIEW -->
<section id="view-paths" class="view-section hidden space-y-6">
<div class="flex justify-between items-end border-b border-neon-cyan/20 pb-2">
<h2 class="text-xl text-neon-cyan font-bold">Golden Paths</h2>
<div class="text-xs text-neon-cyan/50 font-mono">RECOMMENDED WORKFLOWS</div>
</div>
<div class="space-y-4 pl-4" id="paths-container">
<!-- Paths injected via JS -->
</div>
</section>
<!-- 3. TEMPLATES VIEW -->
<section id="view-templates" class="view-section hidden space-y-6">
<div class="flex justify-between items-end border-b border-neon-cyan/20 pb-2">
<h2 class="text-xl text-neon-cyan font-bold">Code Templates</h2>
<div class="text-xs text-neon-cyan/50 font-mono">BASE64 ENCODED</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6" id="templates-grid">
<!-- Templates injected via JS -->
</div>
</section>
<!-- 4. SCAFFOLDING VIEW -->
<section id="view-scaffold" class="view-section hidden h-full flex flex-col">
<div class="flex justify-between items-end border-b border-neon-cyan/20 pb-2 mb-6">
<h2 class="text-xl text-neon-cyan font-bold">Project Scaffolder</h2>
</div>
<div class="flex-1 flex flex-col md:flex-row gap-6">
<!-- Configuration Panel -->
<div class="w-full md:w-1/3 flex flex-col gap-4">
<div class="panel-bg border border-neon-cyan/30 p-4 relative overflow-hidden corner-decor">
<label class="block text-xs text-neon-amber font-bold mb-1">PROJECT TYPE</label>
<select id="scaffold-type" class="w-full bg-black/80 border border-neon-cyan/50 text-neon-cyan px-2 py-2 font-mono text-sm focus:outline-none focus:shadow-[0_0_10px_rgba(0,243,255,0.5)]">
<option value="react-ts">React + TypeScript (App Shell)</option>
<option value="node-api">Node.js REST API</option>
<option value="wasm-pkg">WebAssembly Package</option>
</select>
</div>
<div class="panel-bg border border-neon-cyan/30 p-4 relative overflow-hidden corner-decor">
<label class="block text-xs text-neon-amber font-bold mb-1">NAMESPACE</label>
<input type="text" id="scaffold-name" value="nexus_project_01" class="w-full bg-black/80 border border-neon-cyan/50 text-neon-cyan px-2 py-2 font-mono text-sm focus:outline-none focus:shadow-[0_0_10px_rgba(0,243,255,0.5)]">
</div>
<div class="flex-1 flex items-end">
<button id="btn-scaffold-exec" class="w-full bg-neon-cyan/10 border border-neon-cyan text-neon-cyan py-3 font-bold text-sm hover:bg-neon-cyan hover:text-black transition-all duration-200 shadow-[0_0_15px_rgba(0,243,255,0.2)] flex justify-center items-center gap-2 group">
<span>INITIATE BUILD</span>
<svg class="w-4 h-4 group-hover:animate-spin-slow" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
</button>
</div>
</div>
<!-- Terminal Output -->
<div class="flex-1 flex flex-col">
<div class="panel-bg border border-neon-cyan/30 flex-1 flex flex-col relative overflow-hidden corner-decor">
<div class="bg-neon-cyan/10 px-3 py-1 border-b border-neon-cyan/30 flex justify-between items-center">
<span class="text-xs font-bold text-neon-cyan">TERMINAL_OUTPUT_[SOCKET_01]</span>
<span class="text-xs text-neon-cyan/50">root@nexus:~#</span>
</div>
<div id="terminal-content" class="flex-1 p-3 font-mono text-xs leading-5 overflow-y-auto text-gray-300">
<div class="text-neon-amber mb-2">[SYSTEM] Ready to scaffold. Select options and execute.</div>
<div class="text-gray-500 mb-4">$ scanning environment...</div>
</div>
</div>
</div>
</div>
</section>
</main>
</div>
<!-- Footer HUD -->
<footer class="h-8 border-t border-neon-cyan/30 bg-black/50 flex items-center px-4 text-[10px] text-neon-cyan/50 font-mono justify-between z-20">
<div class="flex gap-4">
<span>MEM: 64PB</span>
<span>CPU: QUANTUM_CORE</span>
<span>UPTIME: 2077.44.1</span>
</div>
<div class="flex gap-4">
<span>ENCRYPT: TLS_1.3</span>
<span>LATENCY: 2ms</span>
<span class="text-green-500">CONN: ONLINE</span>
</div>
</footer>
<!-- JS Logic -->
<script>
// --- DATA MODELS ---
const catalogItems = [
{ id: 'neural-net', name: 'Neural Inference API', ver: 'v4.2', status: 'LIVE', type: 'AI' },
{ id: 'quant-db', name: 'Quantum Storage Grid', ver: 'v2.0', status: 'DEPLOYING', type: 'DB' },
{ id: 'holo-render', name: 'Holo-Render Engine', ver: 'v1.5', status: 'BETA', type: 'UI' },
{ id: 'auth-shield', name: 'Auth Shield OIDC', ver: 'v3.1', status: 'STABLE', type: 'SEC' },
{ id: 'data-stream', name: 'Global Stream Bus', ver: 'v5.0', status: 'LIVE', type: 'NET' },
{ id: 'crypto-vault', name: 'Crypto Vault', ver: 'v0.9', status: 'ALPHA', type: 'SEC' },
];
const goldenPaths = [
{
title: 'Deploy First AI Agent',
steps: ['Initialize Auth', 'Configure Neural API', 'Upload Model Weights', 'Set Inference Limits'],
difficulty: 'Easy',
color: 'text-neon-cyan'
},
{
title: 'Set Up Payment Rail',
steps: ['Create Merchant Account', 'Generate Public Key', 'Integrate Webhook', 'Test Micro-transaction'],
difficulty: 'Medium',
color: 'text-neon-magenta'
},
{
title: 'Global Edge Deployment',
steps: ['Select Regions', 'Configure CDN', 'Push-to-Edge', 'Monitor Latency Mesh'],
difficulty: 'Hard',
color: 'text-neon-amber'
}
];
const templates = [
{
name: 'Express API Boilerplate',
lang: 'javascript',
icon: 'JS',
code: `const express = require('express');\nconst app = express();\n\napp.get('/data', (req, res) => {\n return res.json({ nexus: true });\n});\n\napp.listen(3000, () => {\n console.log('Core Online');\n});`
},
{
name: 'React Component (TSX)',
lang: 'typescript',
icon: 'TS',
code: `import React from 'react';\n\ninterface Props {\n data: string;\n}\n\nexport const NexusCard: React.FC<Props> = ({ data }) => (\n <div className="card">\n <h1>{data}</h1>\n </div>\n);`
},
{
name: 'Docker Manifest',
lang: 'yaml',
icon: 'YML',
code: `version: '3.8'\nservices:\n nexus-app:\n image: nexus/portal:latest\n ports:\n - "8080:80"\n deploy:\n replicas: 3`
}
];
// --- DOM ELEMENTS ---
const catalogGrid = document.getElementById('catalog-grid');
const pathsContainer = document.getElementById('paths-container');
const templatesGrid = document.getElementById('templates-grid');
const terminalContent = document.getElementById('terminal-content');
const terminalLine = (text, color='gray') => `<div class="mb-1 text-${color}">${text}</div>`;
// --- INITIALIZATION ---
function init() {
renderCatalog();
renderPaths();
renderTemplates();
startClock();
initCanvas();
initDataRain();
}
// --- RENDERING ---
function renderCatalog() {
catalogGrid.innerHTML = catalogItems.map(item => `
<div class="panel-bg border border-neon-cyan/30 p-4 relative overflow-hidden corner-decor group cursor-pointer hover:bg-neon-cyan/5 transition-all duration-300">
<div class="absolute top-0 right-0 p-2 opacity-0 group-hover:opacity-100 transition-opacity">
<div class="w-2 h-2 bg-neon-cyan rounded-full animate-ping"></div>
</div>
<div class="flex justify-between items-start mb-3">
<span class="text-xs font-bold text-neon-magenta border border-neon-magenta/30 px-2 py-0.5">${item.type}</span>
<span class="text-xs text-gray-500">${item.ver}</span>
</div>
<h3 class="text-neon-cyan text-sm font-bold mb-1 tracking-wide">${item.name}</h3>
<div class="flex items-center gap-2 mt-3">
<div class="h-1 flex-1 bg-gray-800 rounded overflow-hidden">
<div class="h-full bg-neon-cyan/80 w-[85%] shadow-[0_0_5px_#00f3ff]"></div>
</div>
<span class="text-[10px] text-neon-cyan/70 uppercase">${item.status}</span>
</div>
<button class="mt-3 w-full text-xs border border-neon-cyan/30 text-neon-cyan py-1 hover:bg-neon-cyan hover:text-black transition-colors opacity-0 group-hover:opacity-100">
INIT_HANDSHAKE
</button>
</div>
`).join('');
}
function renderPaths() {
pathsContainer.innerHTML = goldenPaths.map(path => `
<div class="border-l-2 border-neon-cyan/30 pl-4 py-1 relative group hover:bg-white/5 transition-colors">
<!-- Timeline Dot -->
<div class="absolute -left-[5px] top-2 w-2.5 h-2.5 bg-neon-cyan rounded-full shadow-[0_0_8px_#00f3ff] group-hover:bg-neon-magenta group-hover:shadow-[0_0_8px_#ff00ff] transition-colors duration-300"></div>
<div class="flex justify-between mb-2">
<h4 class="font-bold text-sm group-hover:text-neon-cyan transition-colors">${path.title}</h4>
<span class="text-xs text-neon-amber/70 border border-neon-amber/30 px-1 rounded">${path.difficulty}</span>
</div>
<div class="grid grid-cols-2 gap-2 text-xs text-gray-500 font-mono">
${path.steps.map(step => `<div class="flex items-center gap-1"><span class="w-1 h-1 bg-gray-600 rounded-full"></span> ${step}</div>`).join('')}
</div>
</div>
`).join('');
}
function renderTemplates() {
templatesGrid.innerHTML = templates.map(t => `
<div class="panel-bg border border-neon-cyan/30 relative overflow-hidden corner-decor flex flex-col group">
<!-- Header -->
<div class="bg-black/40 p-2 border-b border-neon-cyan/20 flex justify-between items-center">
<div class="flex items-center gap-2">
<span class="text-xs font-bold text-neon-magenta">${t.icon}</span>
<span class="text-xs font-mono truncate max-w-[150px]">${t.name}</span>
</div>
<button class="copy-btn text-xs border border-neon-cyan/30 px-2 py-0.5 text-neon-cyan hover:bg-neon-cyan hover:text-black transition-colors">
/COPY
</button>
</div>
<!-- Code Preview -->
<div class="p-3 flex-1 bg-black/80 font-mono text-[10px] leading-tight text-gray-300 overflow-hidden relative">
<pre class="whitespace-pre-wrap select-none cursor-text">${t.code}</pre>
<!-- Hover Overlay Effect -->
<div class="absolute inset-0 bg-neon-cyan/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"></div>
</div>
</div>
`).join('');
// Add Copy Listeners
document.querySelectorAll('.copy-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
e.target.innerText = 'COPIED';
e.target.classList.add('bg-neon-cyan', 'text-black');
setTimeout(() => {
e.target.innerText = '/COPY';
e.target.classList.remove('bg-neon-cyan', 'text-black');
}, 1500);
});
});
}
// --- NAVIGATION LOGIC ---
window.switchTab = function(tabName) {
// Update Navigation Buttons
document.querySelectorAll('.nav-btn').forEach(btn => {
const span = btn.querySelector('span');
if(btn.id === `nav-${tabName}`) {
btn.classList.add('border-l-2', 'border-neon-cyan', 'bg-neon-cyan/10');
span.classList.remove('text-neon-cyan/40');
span.classList.add('text-neon-cyan');
} else {
btn.classList.remove('border-l-2', 'border-neon-cyan', 'bg-neon-cyan/10');
span.classList.remove('text-neon-cyan');
span.classList.add('text-neon-cyan/40');
}
});
// Update Views
document.querySelectorAll('.view-section').forEach(view => {
view.classList.add('hidden');
});
document.getElementById(`view-${tabName}`).classList.remove('hidden');
// Trigger small glitch on activate
activateGlitch();
};
function activateGlitch() {
const title = document.querySelector('h2'); // Assuming main title
const originalText = title.innerText;
let iterations = 0;
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#@&";
const interval = setInterval(() => {
title.innerText = title.innerText.split("")
.map((letter, index) => {
if (index < iterations) {
return originalText[index];
}
return letters[Math.floor(Math.random() * 26)];
})
.join("");
if (iterations >= originalText.length) {
clearInterval(interval);
}
iterations += 1 / 3;
}, 30);
}
// --- SCAFFOLDING ENGINE (Simulation) ---
document.getElementById('btn-scaffold-exec').addEventListener('click', function() {
const btn = this;
const name = document.getElementById('scaffold-name').value;
const type = document.getElementById('scaffold-type').value;
const terminal = document.getElementById('terminal-content');
if (btn.disabled) return;
btn.disabled = true;
btn.innerHTML = `<span class="animate-pulse">PROCESSING...</span>`;
terminal.innerHTML = ''; // Clear previous
const log = (msg, color='gray') => {
const div = document.createElement('div');
div.className = `mb-1 text-${color} animate-fade-in`;
div.innerText = msg;
terminal.appendChild(div);
terminal.scrollTop = terminal.scrollHeight;
};
// Simulation Sequence
const steps = [
{ t: 500, txt: `> initializing nexus-cli@${new Date().getFullYear()}...`, c: 'neon-cyan' },
{ t: 800, txt: `> validating namespace: [${name}]`, c: 'neon-cyan' },
{ t: 1200, txt: `> resolving dependencies for {${type}}...`, c: 'gray' },
{ t: 1800, txt: `> downloading base templates (12MB)...`, c: 'gray' },
{ t: 2400, txt: `[OK] Template cache verified.`, c: 'neon-amber' },
{ t: 3000, txt: `> generating directory structure...`, c: 'gray' },
{ t: 3500, txt: `> writing src/main/${type}/index.nex`, c: 'gray' },
{ t: 3800, txt: `> config: nexus.config.json written`, c: 'neon-cyan' },
{ t: 4200, txt: `> installing core security modules...`, c: 'neon-magenta' },
{ t: 4800, txt: `> running post-build integrity check...`, c: 'neon-amber' },
{ t: 5200, txt: `[SUCCESS] Project identity forged.`, c: 'neon-cyan' },
{ t: 5400, txt: `> archive ready: /tmp/${name}.nexus.tar.gz`, c: 'neon-amber' }
];
let currentStep = 0;
function nextStep() {
if (currentStep >= steps.length) {
btn.innerHTML = `<span class="text-neon-cyan">BUILD COMPLETE</span>`;
// Add a "Download" fake element
const dl = document.createElement('button');
dl.className = "mt-2 w-full bg-neon-cyan text-black font-bold py-1 text-xs hover:bg-white";
dl.innerText = "DOWNLOAD_PACKAGE >>";
terminal.appendChild(dl);
return;
}
const step = steps[currentStep];
setTimeout(() => {
log(step.txt, step.c);
currentStep++;
nextStep();
}, step.t - (currentStep === 0 ? 0 : steps[currentStep-1].t));
}
nextStep();
});
// --- VISUAL FX CANVAS (Server Load) ---
function initCanvas() {
const canvas = document.getElementById('server-load-canvas');
const ctx = canvas.getContext('2d');
let ticks = 0;
function draw() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Draw a grid line
ctx.strokeStyle = 'rgba(0, 243, 255, 0.2)';
ctx.beginPath();
ctx.moveTo(0, 20);
ctx.lineTo(canvas.width, 20);
ctx.stroke();
// Draw Waveform
ctx.strokeStyle = '#00f3ff';
ctx.lineWidth = 1;
ctx.shadowBlur = 4;
ctx.shadowColor = '#00f3ff';
ctx.beginPath();
const points = 50;
for(let i=0; i<=points; i++) {
const x = (i/points) * canvas.width;
// Combine sine waves
const y = 20 + Math.sin(i * 0.2 + ticks) * 10 + Math.random() * 2;
if(i===0) ctx.moveTo(x, y);
else ctx.lineTo(x, y);
}
ctx.stroke();
// Reset shadow for performance
ctx.shadowBlur = 0;
ticks += 0.1;
requestAnimationFrame(draw);
}
draw();
}
// --- CLOCK ---
function startClock() {
const el = document.getElementById('sys-time');
setInterval(() => {
const now = new Date();
// Simulate 1977 style or just high precision
const time = now.toISOString().split('T')[1].replace('Z', '') + ':' + Math.floor(now.getMilliseconds()/10);
el.innerText = time;
}, 50);
}
// --- BACKGROUND DATA RAIN (ASCII) ---
function initDataRain() {
const el = document.querySelector('.data-rain');
let text = '';
const chars = '01';
for(let i=0; i< 50; i++) {
let line = '';
for(let j=0; j< 80; j++) {
line += Math.random() > 0.5 ? '1' : '0';
}
text += line + '\n';
}
el.setAttribute('data-text', text);
}
// Run Init
init();
</script>
</body>
</html>