<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NeuronAnnotation SDK // FUI DASHBOARD</title>
<!-- Load Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Configure Tailwind with Cyberpunk palette and custom styles -->
<script>
tailwind.config = {
theme: {
extend: {
colors: {
dark: '#050505',
dim: '#0a0a0a',
cyan: {
DEFAULT: '#00f3ff',
dim: 'rgba(0, 243, 255, 0.2)',
glow: 'rgba(0, 243, 255, 0.6)'
},
amber: '#ffae00',
magenta: '#ff00ff',
glass: 'rgba(10, 10, 10, 0.8)'
},
fontFamily: {
mono: ['"JetBrains Mono"', '"Courier New"', 'monospace']
},
boxShadow: {
'neon-cyan': '0 0 10px #00f3ff, 0 0 2px #00f3ff inset',
'neon-cyan-lg': '0 0 20px rgba(0, 243, 255, 0.5)',
'neon-magenta': '0 0 10px #ff00ff'
},
backgroundImage: {
'grid-pattern': 'linear-gradient(to right, #1a1a1a 1px, transparent 1px), linear-gradient(to bottom, #1a1a1a 1px, transparent 1px)',
'scanline': '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))'
}
}
}
}
</script>
<style>
/* Global Reset & Base */
body, html {
background-color: #050505;
color: #e0e0e0;
font-family: 'JetBrains Mono', monospace;
overflow: hidden; /* HUD style, no scroll on body */
margin: 0;
padding: 0;
height: 100vh;
width: 100vw;
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
background: #00f3ff;
border-radius: 0;
}
/* CRT Scanline Overlay */
.crt-overlay {
position: fixed;
top: 0; left: 0; width: 100vw; height: 100vh;
background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
background-size: 100% 4px;
pointer-events: none;
z-index: 50;
opacity: 0.6;
}
/* FUI Corner Decorations */
.corner-decor {
position: absolute;
width: 20px;
height: 20px;
border: 2px solid #00f3ff;
transition: all 0.3s ease;
}
.corner-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.corner-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.corner-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.corner-br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
/* Animation: Glitch Twitch */
@keyframes glitch-anim {
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-active {
animation: glitch-anim 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
color: #ff00ff;
text-shadow: 2px 0 #00f3ff;
}
/* Animation: Breathing Border */
@keyframes border-pulse {
0% { box-shadow: inset 0 0 5px rgba(0, 243, 255, 0.3); border-color: rgba(0, 243, 255, 0.8); }
50% { box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.1); border-color: rgba(0, 243, 255, 0.4); }
100% { box-shadow: inset 0 0 5px rgba(0, 243, 255, 0.3); border-color: rgba(0, 243, 255, 0.8); }
}
.active-border {
animation: border-pulse 3s infinite;
}
/* Typography Effects */
.title-text {
font-size: 0.85rem;
letter-spacing: 0.1em;
text-transform: uppercase;
}
/* Custom Input Styles */
.fui-input {
background: rgba(0, 0, 0, 0.5);
border: 1px solid #333;
color: #00f3ff;
font-family: inherit;
outline: none;
transition: all 0.2s;
}
.fui-input:focus {
border-color: #00f3ff;
box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}
/* Code Block */
pre.code-block {
background: #080808;
border: 1px solid #333;
padding: 1rem;
color: #aaf;
font-size: 0.8rem;
line-height: 1.5;
overflow-x: auto;
}
/* Switching Tabs Animation */
.tab-content {
display: none;
opacity: 0;
transition: opacity 0.3s ease-in;
}
.tab-content.active {
display: block;
opacity: 1;
}
/* Canvas for Radar */
#analytics-canvas {
width: 100%;
height: 300px;
background: radial-gradient(circle, rgba(0,20,30,0.5) 0%, rgba(0,0,0,0) 70%);
}
</style>
</head>
<body>
<!-- Global Scanlines -->
<div class="crt-overlay"></div>
<!-- Grid Background (Tailwind Pattern) -->
<div class="absolute inset-0 bg-grid-pattern bg-[length:40px_40px] opacity-20 pointer-events-none z-0"></div>
<!-- Header HUD -->
<header class="relative z-10 flex items-center justify-between px-6 py-2 border-b border-cyan-dim bg-dim/90 backdrop-blur">
<div class="flex items-center space-x-4">
<div class="w-8 h-8 flex items-center justify-center border border-cyan glow bg-black">
<span class="text-cyan font-bold">N</span>
</div>
<h1 class="title-text text-cyan tracking-widest flex items-center">
NEURON<span class="mx-2 text-gray-600">///</span>ANNOTATION SDK
<span id="version" class="text-xs text-gray-500 ml-2 border border-gray-700 px-1">v2.0.77</span>
</h1>
</div>
<div class="flex items-center space-x-8 text-xs font-mono">
<div class="text-cyan">SYS.STATUS: <span class="text-green-400">ONLINE</span></div>
<div class="text-cyan">MEMORY: <span class="text-amber blinking">12.4TB</span></div>
<div class="text-cyan" id="clock">00:00:00</div>
</div>
</header>
<!-- Main Layout -->
<div class="relative z-10 flex h-[calc(100vh-52px)]">
<!-- Sidebar Navigation -->
<nav class="w-64 border-r border-cyan-dim bg-dark flex flex-col p-4 space-y-2">
<div class="px-2 mb-4 text-xs text-gray-500 uppercase">Plugin Modules</div>
<button onclick="switchTab('validation')" id="btn-validation" class="nav-btn flex items-center space-x-2 p-2 text-left text-sm border border-transparent hover:border-cyan hover:bg-cyan-dim/20 text-cyan transition-all group">
<span class="text-lg">[1]</span> <span>Validation Rules</span>
<div class="ml-auto w-1 h-1 bg-cyan rounded-full opacity-0 group-hover:opacity-100"></div>
</button>
<button onclick="switchTab('shortcuts')" id="btn-shortcuts" class="nav-btn flex items-center space-x-2 p-2 text-left text-sm border border-transparent hover:border-magenta hover:bg-magenta/20 text-gray-400 hover:text-magenta transition-all group">
<span class="text-lg">[2]</span> <span>Shortcuts Config</span>
</button>
<button onclick="switchTab('analytics')" id="btn-analytics" class="nav-btn flex items-center space-x-2 p-2 text-left text-sm border border-transparent hover:border-amber hover:bg-amber/20 text-gray-400 hover:text-amber transition-all group">
<span class="text-lg">[3]</span> <span>Analytics Core</span>
</button>
<!-- Decorative Spacer -->
<div class="flex-grow"></div>
<!-- System Console Mini -->
<div class="border border-gray-800 bg-black p-2 text-xs font-mono text-green-600 h-32 overflow-hidden relative">
<div class="absolute top-0 left-0 w-full h-full p-2 overflow-y-auto" id="system-log">
<div>> SYSTEM BOOT...</div>
<div>> LOADING KERNEL...</div>
<div>> MOUNTING VOLUMES...</div>
<div>> SDK READY.</div>
</div>
</div>
</nav>
<!-- Main Content Area -->
<main class="flex-1 relative bg-dark p-8 overflow-y-auto">
<!-- Background Radar (Canvas) -->
<canvas id="radar" class="absolute top-0 right-0 w-1/2 h-full pointer-events-none opacity-30"></canvas>
<!-- Decorative Header Corners -->
<div class="absolute top-0 left-0 w-10 h-10 border-t-2 border-l-2 border-cyan"></div>
<div class="absolute top-0 right-0 w-10 h-10 border-t-2 border-r-2 border-cyan"></div>
<div class="absolute bottom-0 left-0 w-10 h-10 border-b-2 border-l-2 border-cyan"></div>
<div class="absolute bottom-0 right-0 w-10 h-10 border-b-2 border-r-2 border-cyan"></div>
<!-- TABS CONTENT -->
<!-- TAB 1: VALIDATION RULES -->
<section id="validation" class="tab-content active space-y-6">
<div class="flex justify-between items-start">
<div>
<h2 class="text-2xl text-cyan glow mb-2">VALIDATION ENGINE</h2>
<p class="text-gray-400 text-sm max-w-lg">Define custom schemas and regex patterns for annotation integrity. Plugins can inject rules into the main execution pipeline.</p>
</div>
<div class="flex space-x-2">
<button class="px-4 py-1 text-xs border border-cyan text-cyan hover:bg-cyan hover:text-black transition-colors font-bold">RELOAD CONFIG</button>
<button class="px-4 py-1 text-xs border border-magenta text-magenta hover:bg-magenta hover:text-black transition-colors font-bold">DEploy</button>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Active Rule List -->
<div class="bg-glass border border-gray-800 p-1 relative">
<div class="corner-decor corner-tl"></div>
<div class="corner-decor corner-tr"></div>
<div class="corner-decor corner-bl"></div>
<div class="corner-decor corner-br"></div>
<div class="p-4 border-b border-gray-800 flex justify-between items-center bg-black/50">
<span class="text-cyan font-bold text-sm">ACTIVE RULES</span>
<span class="text-xs text-gray-500">4 REGISTERED</span>
</div>
<div class="p-2 space-y-2 max-h-96 overflow-y-auto">
<!-- Rule Item -->
<div class="bg-gray-900 border border-gray-800 p-3 group hover:border-cyan transition-colors cursor-pointer">
<div class="flex justify-between items-center mb-1">
<span class="text-white font-mono text-sm">REQUIRE_LABEL</span>
<span class="text-xs px-2 py-0.5 bg-green-900/30 text-green-400 border border-green-900">CORE</span>
</div>
<div class="text-xs text-gray-500 mono">annotation.label !== null</div>
</div>
<!-- Rule Item -->
<div class="bg-gray-900 border border-gray-800 p-3 group hover:border-cyan transition-colors cursor-pointer">
<div class="flex justify-between items-center mb-1">
<span class="text-white font-mono text-sm">BBOX_AREA_MIN</span>
<span class="text-xs px-2 py-0.5 bg-blue-900/30 text-blue-400 border border-blue-900">GEOMETRY</span>
</div>
<div class="text-xs text-gray-500 mono">(w * h) > 100 square units</div>
</div>
<!-- Rule Item -->
<div class="bg-gray-900 border border-cyan/50 p-3 group hover:border-cyan transition-colors cursor-pointer relative">
<div class="absolute top-0 right-0 w-2 h-2 bg-cyan animate-pulse"></div>
<div class="flex justify-between items-center mb-1">
<span class="text-white font-mono text-sm">CUSTOM_REGEX</span>
<span class="text-xs px-2 py-0.5 bg-magenta-900/30 text-magenta border border-magenta-900">PLUGIN</span>
</div>
<div class="text-xs text-gray-400 mono">/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i</div>
</div>
<!-- Rule Item -->
<div class="bg-gray-900 border border-gray-800 p-3 group hover:border-cyan transition-colors cursor-pointer">
<div class="flex justify-between items-center mb-1">
<span class="text-white font-mono text-sm">TIMESTAMP_VALID</span>
<span class="text-xs px-2 py-0.5 bg-gray-700 text-gray-300">SYSTEM</span>
</div>
<div class="text-xs text-gray-500 mono">Date.parse(annotation.createdAt) > 0</div>
</div>
</div>
</div>
<!-- Configuration Editor (Fake Code) -->
<div class="flex flex-col space-y-4">
<div class="bg-glass border border-gray-800 p-0 relative flex-grow flex flex-col">
<div class="flex justify-between items-center px-4 py-2 bg-black border-b border-gray-800">
<span class="text-xs text-gray-400">SDK_INJECTION_POINT.js</span>
<span class="text-cyan text-xs">[EDITABLE]</span>
</div>
<div class="relative flex-grow p-4 overflow-x-auto">
<pre class="code-block h-full">
// Register a custom validation plugin
import { ValidationEngine } from '@neuron/sdk';
const engine = new ValidationEngine();
// Define rule: Attribute must match hex color code
engine.registerRule('VALID_HEX_COLOR', {
test: (value) => /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(value),
message: "Invalid Hex format. Use #RRGGBB"
});
// Hook into pipeline
engine.on('failure', (err) => {
console.error(`[VALIDATION] ${err.rule} failed`);
Analytics.track('validation_error', { rule: err.rule });
});
export default engine;
</pre>
<div class="absolute bottom-4 right-4 text-xs text-gray-600 animate-pulse">● RECORDING INPUT</div>
</div>
</div>
</div>
</div>
</section>
<!-- TAB 2: SHORTCUTS -->
<section id="shortcuts" class="tab-content space-y-6">
<div>
<h2 class="text-2xl text-magenta glow mb-2">KEYBIND MATRIX</h2>
<p class="text-gray-400 text-sm">Remap annotation tool shortcuts globally. Override default bindings or create context-sensitive macros.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Key Visualizer -->
<div class="bg-black border border-magenta/50 p-6 relative hologram">
<div class="text-center text-xs text-gray-500 mb-2 uppercase">Active Binding Profile</div>
<div class="flex flex-wrap justify-center gap-2">
<div class="key w-12 h-12 border border-magenta/50 flex items-center justify-center text-magenta shadow-[0_0_10px_rgba(255,0,255,0.2)]">
<span class="text-lg">Ctrl</span>
</div>
<div class="key w-12 h-12 border border-magenta/50 flex items-center justify-center text-magenta shadow-[0_0_10px_rgba(255,0,255,0.2)]">
<span class="text-lg">+</span>
</div>
<div class="key w-12 h-12 border border-cyan flex items-center justify-center text-cyan shadow-neon-magenta">
<span class="text-lg">Z</span>
</div>
</div>
<div class="mt-4 text-center text-cyan font-bold text-sm">Action: UNDO</div>
<div class="mt-2 h-1 w-full bg-gray-800 relative overflow-hidden">
<div class="absolute top-0 left-0 h-full bg-magenta w-1/3 animate-pulse"></div>
</div>
</div>
<!-- Shortcut List -->
<div class="bg-glass border border-gray-800 p-4 relative col-span-2">
<div class="corner-decor corner-tl"></div>
<div class="corner-decor corner-tr"></div>
<div class="overflow-x-auto">
<table class="w-full text-left text-sm text-gray-400 font-mono">
<thead class="text-cyan border-b border-gray-800">
<tr>
<th class="pb-2">HOTKEY</th>
<th class="pb-2">ACTION ID</th>
<th class="pb-2">CONTEXT</th>
<th class="pb-2 text-right">STATUS</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-900">
<tr class="hover:bg-white/5 transition-colors">
<td class="py-3"><span class="px-2 py-1 border border-gray-700 rounded text-white bg-black">Ctrl + N</span></td>
<td class="text-magenta">create_new_annotation</td>
<td>global</td>
<td class="text-right text-green-400">ACTIVE</td>
</tr>
<tr class="hover:bg-white/5 transition-colors">
<td class="py-3"><span class="px-2 py-1 border border-gray-700 rounded text-white bg-black">W / A / S / D</span></td>
<td class="text-magenta">viewport_move</td>
<td>canvas</td>
<td class="text-right text-green-400">ACTIVE</td>
</tr>
<tr class="hover:bg-white/5 transition-colors">
<td class="py-3"><span class="px-2 py-1 border border-gray-700 rounded text-white bg-black">Del</span></td>
<td class="text-magenta">delete_selected</td>
<td>selection</td>
<td class="text-right text-yellow-500">CONFLICT</td>
</tr>
<tr class="hover:bg-white/5 transition-colors">
<td class="py-3"><span class="px-2 py-1 border border-gray-700 rounded text-white bg-black">Ctrl + Shift + C</span></td>
<td class="text-cyan-magenta">toggle_ocr_scan</td>
<td>global</td>
<td class="text-right text-green-400">ACTIVE</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!-- TAB 3: ANALYTICS -->
<section id="analytics" class="tab-content space-y-6">
<div>
<h2 class="text-2xl text-amber glow mb-2">LIVE ANALYTICS</h2>
<p class="text-gray-400 text-sm">Real-time performance monitoring and plugin usage statistics. Data stream injected directly from the annotation engine.</p>
</div>
<!-- Metrics Cards -->
<div class="grid grid-cols-4 gap-4">
<div class="bg-gray-900 border border-gray-800 p-4 relative hover:border-amber transition-colors">
<div class="text-xs text-gray-500 uppercase mb-1">Annotations / Sec</div>
<div class="text-3xl font-mono text-amber counting-up" data-target="1452">0</div>
<div class="absolute top-2 right-2 w-2 h-2 bg-green-500 rounded-full animate-ping"></div>
</div>
<div class="bg-gray-900 border border-gray-800 p-4 relative hover:border-amber transition-colors">
<div class="text-xs text-gray-500 uppercase mb-1">API Latency (ms)</div>
<div class="text-3xl font-mono text-cyan counting-up" data-target="24">0</div>
<div class="absolute top-2 right-2 text-[10px] text-green-400">-5.2%</div>
</div>
<div class="bg-gray-900 border border-gray-800 p-4 relative hover:border-amber transition-colors">
<div class="text-xs text-gray-500 uppercase mb-1">CPU Load</div>
<div class="text-3xl font-mono text-white counting-up" data-target="42">0</div>
<div class="absolute top-2 right-2 text-[10px] text-amber">STABLE</div>
</div>
<div class="bg-gray-900 border border-gray-800 p-4 relative hover:border-amber transition-colors">
<div class="text-xs text-gray-500 uppercase mb-1">Rules Hit</div>
<div class="text-3xl font-mono text-magenta counting-up" data-target="8901">0</div>
<div class="absolute top-2 right-2 text-[10px] text-magenta">ACTIVE</div>
</div>
</div>
<!-- Radar Graph Canvas -->
<div class="bg-black border border-gray-800 p-4 relative">
<div class="flex justify-between items-center mb-4">
<span class="text-xs text-cyan font-bold uppercase">Network Topology // Data Nodes</span>
<div class="flex space-x-2">
<div class="w-2 h-2 bg-cyan rounded-full"></div>
<div class="w-2 h-2 bg-gray-600 rounded-full"></div>
</div>
</div>
<div class="relative w-full h-64 border border-gray-800 bg-[url('data:image/svg+xml;base64,PHN2Zy4uLgo=')] bg-cover">
<canvas id="radar-canvas" class="absolute inset-0 w-full h-full"></canvas>
</div>
</div>
</section>
</main>
</div>
<!-- JS Logic -->
<script>
/**
* NEURON ANNOTATION SDK - UI INTERFACE CONTROLLER
* Handles tab switching, canvas rendering, text decoding, and simulated analytics.
*/
// --- State Management ---
const state = {
activeTab: 'validation',
stats: {
annotationsPerSec: 1452,
latency: 24,
cpu: 42,
rulesHit: 8901
},
shortcuts: [
{ keys: 'Ctrl+N', action: 'create_new_annotation' },
{ keys: 'W/A/S/D', action: 'viewport_move' },
{ keys: 'Del', action: 'delete_selected' },
{ keys: 'Ctrl+Shift+C', action: 'toggle_ocr_scan' }
]
};
// --- Utility: Random Character Generator for Decoding Effect ---
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?';
function getRandomChar() {
return chars[Math.floor(Math.random() * chars.length)];
}
// Decode Text Effect
function decodeElement(element, finalText, duration = 1000) {
let iterations = 0;
const interval = setInterval(() => {
element.innerText = finalText
.split('')
.map((letter, index) => {
if (index < iterations) {
return finalText[index];
}
return getRandomChar();
})
.join('');
if (iterations >= finalText.length) {
clearInterval(interval);
}
iterations += 1 / 2; // speed control
}, 30);
}
// --- Navigation Logic ---
function switchTab(tabId) {
// Update state
state.activeTab = tabId;
// UI Tab Switching
document.querySelectorAll('.tab-content').forEach(el => {
el.classList.remove('active');
});
document.getElementById(tabId).classList.add('active');
// Update Sidebar Styles
document.querySelectorAll('.nav-btn').forEach(btn => {
btn.classList.remove('border-cyan', 'bg-cyan-dim/20', 'text-cyan');
btn.classList.remove('border-magenta', 'bg-magenta/20', 'text-magenta');
btn.classList.add('text-gray-400'); // default inactive
});
const activeBtn = document.getElementById(`btn-${tabId}`);
activeBtn.classList.remove('text-gray-400');
if (tabId === 'validation') {
activeBtn.classList.add('border-cyan', 'bg-cyan-dim/20', 'text-cyan');
} else if (tabId === 'shortcuts') {
activeBtn.classList.add('border-magenta', 'bg-magenta/20', 'text-magenta');
} else if (tabId === 'analytics') {
activeBtn.classList.add('border-amber', 'bg-amber/20', 'text-amber');
}
}
// --- Clock ---
function updateClock() {
const now = new Date();
document.getElementById('clock').innerText = now.toLocaleTimeString('en-US', { hour12: false }) + `.${now.getMilliseconds().toString().padStart(3, '0')}`;
}
setInterval(updateClock, 100);
// --- Log System ---
function addLog(msg) {
const logEl = document.getElementById('system-log');
const entry = document.createElement('div');
entry.textContent = `> ${msg}`;
logEl.appendChild(entry);
logEl.scrollTop = logEl.scrollHeight;
// limit logs
if (logEl.children.length > 20) {
logEl.removeChild(logEl.firstChild);
}
}
// --- Initialize Decoding on Load ---
window.addEventListener('DOMContentLoaded', () => {
const title = document.querySelector('h1');
decodeElement(title, title.textContent, 1500);
addLog('INTERFACE INITIALIZED');
});
// ---------------------------------------------------------
// CANVAS RENDERERS
// ---------------------------------------------------------
/**
* Renderer 1: Background Particle Network (Abstract connectivity)
*/
const bgCanvas = document.createElement('canvas');
bgCanvas.id = 'bg-net';
bgCanvas.style.position = 'fixed';
bgCanvas.style.top = '0';
bgCanvas.style.left = '0';
bgCanvas.style.width = '100%';
bgCanvas.style.height = '100%';
bgCanvas.style.zIndex = '0';
bgCanvas.style.pointerEvents = 'none';
document.body.appendChild(bgCanvas);
const bgCtx = bgCanvas.getContext('2d');
let particles = [];
function resizeBgCanvas() {
bgCanvas.width = window.innerWidth;
bgCanvas.height = window.innerHeight;
initParticles();
}
class Particle {
constructor() {
this.x = Math.random() * bgCanvas.width;
this.y = Math.random() * bgCanvas.height;
this.vx = (Math.random() - 0.5) * 0.5;
this.vy = (Math.random() - 0.5) * 0.5;
this.size = Math.random() * 2;
}
update() {
this.x += this.vx;
this.y += this.vy;
if (this.x < 0 || this.x > bgCanvas.width) this.vx *= -1;
if (this.y < 0 || this.y > bgCanvas.height) this.vy *= -1;
}
draw() {
bgCtx.fillStyle = 'rgba(0, 243, 255, 0.2)';
bgCtx.beginPath();
bgCtx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
bgCtx.fill();
}
}
function initParticles() {
particles = [];
const count = Math.floor((bgCanvas.width * bgCanvas.height) / 15000);
for (let i = 0; i < count; i++) {
particles.push(new Particle());
}
}
function animateBg() {
bgCtx.clearRect(0, 0, bgCanvas.width, bgCanvas.height);
bgCtx.strokeStyle = 'rgba(0, 243, 255, 0.05)';
bgCtx.lineWidth = 1;
for (let i = 0; i < particles.length; i++) {
particles[i].update();
particles[i].draw();
// connect close particles
for (let j = i + 1; j < particles.length; j++) {
const dx = particles[i].x - particles[j].x;
const dy = particles[i].y - particles[j].y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 100) {
bgCtx.beginPath();
bgCtx.moveTo(particles[i].x, particles[i].y);
bgCtx.lineTo(particles[j].x, particles[j].y);
bgCtx.stroke();
}
}
}
requestAnimationFrame(animateBg);
}
window.addEventListener('resize', resizeBgCanvas);
resizeBgCanvas();
animateBg();
/**
* Renderer 2: Analytics Radar (Wireframe Polygon)
*/
const radarCanvas = document.getElementById('radar-canvas');
const rCtx = radarCanvas.getContext('2d');
// High DPI scaling
const dpr = window.devicePixelRatio || 1;
const rect = radarCanvas.getBoundingClientRect();
radarCanvas.width = rect.width * dpr;
radarCanvas.height = rect.height * dpr;
rCtx.scale(dpr, dpr);
const radarData = [65, 40, 85, 55, 90, 30]; // Values for a hexagon
const maxVal = 100;
function drawRadar() {
const w = rect.width;
const h = rect.height;
const cx = w / 2;
const cy = h / 2;
const radius = Math.min(w, h) / 2 - 30;
rCtx.clearRect(0, 0, w, h);
// Draw Grid (Concentric polygons)
rCtx.strokeStyle = 'rgba(255, 174, 0, 0.2)';
rCtx.lineWidth = 1;
for(let i = 1; i <= 5; i++) {
const r = (radius / 5) * i;
rCtx.beginPath();
for(let j = 0; j < 6; j++) {
const angle = (Math.PI * 2 / 6) * j - Math.PI/2;
const x = cx + Math.cos(angle) * r;
const y = cy + Math.sin(angle) * r;
if(j===0) rCtx.moveTo(x, y);
else rCtx.lineTo(x, y);
}
rCtx.closePath();
rCtx.stroke();
}
// Draw Data Shape
rCtx.fillStyle = 'rgba(255, 0, 255, 0.15)';
rCtx.strokeStyle = '#ff00ff';
rCtx.lineWidth = 2;
rCtx.beginPath();
for(let j = 0; j < 6; j++) {
const value = radarData[j] || 0;
const r = (value / maxVal) * radius;
const angle = (Math.PI * 2 / 6) * j - Math.PI/2;
const x = cx + Math.cos(angle) * r;
const y = cy + Math.sin(angle) * r;
if(j===0) rCtx.moveTo(x, y);
else rCtx.lineTo(x, y);
}
rCtx.closePath();
rCtx.fill();
rCtx.stroke();
// Draw dots at vertices
rCtx.fillStyle = '#fff';
for(let j = 0; j < 6; j++) {
const value = radarData[j] || 0;
const r = (value / maxVal) * radius;
const angle = (Math.PI * 2 / 6) * j - Math.PI/2;
const x = cx + Math.cos(angle) * r;
const y = cy + Math.sin(angle) * r;
rCtx.beginPath();
rCtx.arc(x, y, 3, 0, Math.PI*2);
rCtx.fill();
}
// Rotate Shape Over Time
// For simplicity, we just animate the data slightly to simulate live feed
}
function animateRadar() {
drawRadar();
// Randomly fluctuate data for "live" feel
if(Math.random() > 0.95) {
const idx = Math.floor(Math.random() * radarData.length);
radarData[idx] = Math.min(100, Math.max(0, radarData[idx] + (Math.random() - 0.5) * 20));
// Clamp
radarData[idx] = Math.floor(radarData[idx]);
}
requestAnimationFrame(animateRadar);
}
animateRadar();
// ---------------------------------------------------------
// SIMULATED ANALYTICS LIVE UPDATES
// ---------------------------------------------------------
setInterval(() => {
// Randomly adjust counters
const sec = document.querySelector('.counting-up[data-target="1452"]');
if(sec) {
let current = parseInt(sec.innerText);
let change = Math.floor(Math.random() * 10);
sec.innerText = current + change;
}
// Random CPU fluctuation
const cpu = document.querySelector('.counting-up[data-target="42"]');
if(cpu) {
let val = parseInt(cpu.innerText);
val = Math.min(100, Math.max(0, val + (Math.random() - 0.5) * 2));
cpu.innerText = val.toFixed(1);
}
}, 2000);
// ---------------------------------------------------------
// INIT INTERACTION
// ---------------------------------------------------------
// Flash the "N" logo occasionally to promote interactivity feeling
setInterval(() => {
const logo = document.querySelector('header .w-8');
logo.classList.add('animate-pulse');
setTimeout(() => logo.classList.remove('animate-pulse'), 500);
}, 4000);
addLog('MODULE: VALIDATION ENGINE LOADED');
addLog('MODULE: SHORTCINTEGRATION: ACTIVE');
</script>
</body>
</html>