<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NEXUS // Real-Time Notification Hub</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts: JetBrains Mono -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&display=swap" rel="stylesheet">
<!-- Three.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
mono: ['"JetBrains Mono"', 'monospace'],
},
colors: {
cyber: {
cyan: '#00f3ff',
magenta: '#ff00ff',
amber: '#ffaa00',
dark: '#050505',
panel: 'rgba(0, 20, 30, 0.85)',
}
},
boxShadow: {
'neon-cyan': '0 0 10px rgba(0, 243, 255, 0.5), 0 0 4px rgba(0, 243, 255, 0.8) inset',
'neon-magenta': '0 0 10px rgba(255, 0, 255, 0.5), 0 0 4px rgba(255, 0, 255, 0.8) inset',
'neon-amber': '0 0 10px rgba(255, 170, 0, 0.5), 0 0 4px rgba(255, 170, 0, 0.8) inset',
}
}
}
}
</script>
<style>
body {
background-color: #050505;
color: #e0faff;
overflow: hidden;
margin: 0;
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.5);
border-left: 1px solid #00f3ff33;
}
::-webkit-scrollbar-thumb {
background: #00f3ff55;
border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
background: #00f3ffaa;
}
/* HUD Grid & Lines */
.hud-border {
border: 1px solid rgba(0, 243, 255, 0.3);
position: relative;
}
.hud-border::before, .hud-border::after {
content: '';
position: absolute;
width: 8px;
height: 8px;
border: 2px solid #00f3ff;
transition: all 0.3s ease;
}
.hud-border::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.hud-border::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.scanline {
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.1) 50%, rgba(0,0,0,0.1));
background-size: 100% 4px;
pointer-events: none;
z-index: 50;
opacity: 0.6;
}
.vignette {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: radial-gradient(circle, transparent 40%, #000000 120%);
pointer-events: none;
z-index: 49;
}
/* Decoding Text Effect */
.decoding-char {
color: #ff00ff;
}
.static-text {
animation: flicker 2s infinite;
}
@keyframes flicker {
0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
20%, 24%, 55% { opacity: 0.4; }
}
@keyframes pulse-bold {
0%, 100% { box-shadow: 0 0 5px rgba(0,243,255,0.3); border-color: rgba(0,243,255,0.4); }
50% { box-shadow: 0 0 15px rgba(0,243,255,0.6); border-color: rgba(0,243,255,0.8); }
}
.notification-enter {
animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn {
from { transform: translateX(-20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
.glitch-dissolve {
animation: glitchOut 0.2s steps(5) forwards;
}
@keyframes glitchOut {
0% { transform: translateX(0); opacity: 1; filter: hue-rotate(0deg); }
100% { transform: translateX(100px); opacity: 0; filter: hue-rotate(90deg); }
}
</style>
</head>
<body class="font-mono antialiased selection:bg-cyber-cyan selection:text-black">
<!-- Background Visuals -->
<div id="canvas-container" class="fixed top-0 left-0 w-full h-full z-0"></div>
<div class="scanline"></div>
<div class="vignette"></div>
<!-- HUD Layout -->
<div id="app" class="relative z-10 w-full h-full flex flex-col p-4 gap-4 max-w-[1920px] mx-auto">
<!-- Header -->
<header class="flex justify-between items-start border-b border-cyber-cyan pb-2 px-2">
<div class="flex flex-col">
<h1 class="text-2xl font-bold text-cyber-cyan tracking-widest static-text">NEXUS_HUB</h1>
<div class="text-xs text-cyber-cyan opacity-70 flex gap-4">
<span>REALTIME_NOTIFICATIONS_V2.4</span>
<span>PUBSUB_SYSTEM</span>
</div>
</div>
<div class="text-right">
<div id="clock" class="text-3xl font-bold text-white tracking-wider mb-1">00:00:00:000</div>
<div class="text-xs text-cyber-amber opacity-80">SYS.STATUS: <span id="sys-status">ONLINE</span></div>
</div>
</header>
<!-- Main Grid -->
<div class="flex-1 grid grid-cols-12 gap-4 min-h-0">
<!-- Left Panel: Connection & Channels -->
<aside class="col-span-3 hud-border bg-cyber-panel p-3 flex flex-col gap-4">
<div class="text-sm font-bold text-cyber-amber mb-2 border-b border-cyber-amber/30 pb-1">
// ACTIVE_CHANNELS
</div>
<!-- Connection State Visualizer -->
<div class="space-y-2">
<div class="flex justify-between items-center group cursor-pointer" onclick="toggleProtocol()">
<span class="text-sm text-cyber-cyan" id="push-label">WEB_PUSH</span>
<div class="w-12 h-6 border border-cyber-cyan/50 rounded relative overflow-hidden">
<div id="push-indicator" class="absolute top-0 left-0 h-full bg-cyber-cyan/30 w-1/2 transition-all"></div>
<div class="absolute inset-0 flex items-center justify-center text-[8px] text-cyber-cyan">
<span id="push-dot" class="w-2 h-2 bg-cyber-cyan rounded-full opacity-0">●</span>
</div>
</div>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-cyber-magenta" id="sse-label">SSE_FALLBACK</span>
<div class="w-12 h-6 border border-cyber-magenta/50 rounded relative overflow-hidden">
<div id="sse-indicator" class="absolute top-0 left-0 h-full bg-cyber-magenta/30 w-0 transition-all"></div>
<div class="absolute inset-0 flex items-center justify-center text-[8px] text-cyber-magenta">
<span id="sse-dot" class="w-2 h-2 bg-cyber-magenta rounded-full opacity-0">●</span>
</div>
</div>
</div>
</div>
<!-- Circular Budget Dial (SVG) -->
<div class="flex-1 flex flex-col items-center justify-center">
<div class="relative w-32 h-32">
<svg viewBox="0 0 36 36" class="w-full h-full transform -rotate-90">
<!-- Background Circle -->
<path d="M18 2.1 a 15.9 15.9 0 0 1 0 31.8" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="3" />
<!-- Progress Arc -->
<path id="budget-arc" d="M18 2.1 a 15.9 15.9 0 0 1 0 31.8" fill="none" stroke="rgba(0, 243, 255, 0.8)" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="0" />
</svg>
<div class="absolute inset-0 flex items-center justify-center flex-col">
<span class="text-xs text-gray-400">BUDGET</span>
<span id="budget-text" class="text-xl font-bold text-cyber-cyan">0%</span>
</div>
<!-- Pulse ring -->
<div id="budget-pulse" class="absolute inset-0 rounded-full border-2 border-cyber-cyan/0 animate-ping"></div>
</div>
<div class="text-[10px] text-gray-500 mt-2 text-center">
MAX_SUBSCRIPTIONS: <span id="budget-limit">100</span>
</div>
</div>
<!-- Log Feed console -->
<div class="h-1/3 border-t border-cyber-magenta/30 pt-2 overflow-hidden flex flex-col">
<div class="text-xs text-cyber-magenta mb-1">// SYS_LOG</div>
<div id="sys-log" class="flex-1 overflow-y-auto text-[10px] text-gray-500 space-y-1 font-mono">
<!-- logs go here -->
</div>
</div>
</aside>
<!-- Center Panel: Notification Stream -->
<main class="col-span-6 relative flex flex-col">
<!-- Corner Brackets -->
<div class="absolute top-0 left-0 w-4 h-4 border-t-2 border-l-2 border-cyber-cyan -mt-px -ml-px"></div>
<div class="absolute top-0 right-0 w-4 h-4 border-t-2 border-r-2 border-cyber-cyan -mt-px -mr-px"></div>
<div class="absolute bottom-0 left-0 w-4 h-4 border-b-2 border-l-2 border-cyber-cyan -mb-px -ml-px"></div>
<div class="absolute bottom-0 right-0 w-4 h-4 border-b-2 border-r-2 border-cyber-cyan -mb-px -mr-px"></div>
<div class="bg-cyber-panel h-full flex flex-col border border-cyber-cyan/20 backdrop-blur-sm">
<div class="p-2 border-b border-cyber-cyan/30 flex justify-between items-center">
<span class="text-sm font-bold text-cyber-cyan">LIVE_INCOMING</span>
<button id="clear-btn" class="text-xs bg-transparent border border-cyber-cyan/50 text-cyber-cyan hover:bg-cyber-cyan hover:text-black transition px-2 py-1">
PURGE_QUEUE
</button>
</div>
<!-- Feed Container -->
<div id="notification-feed" class="flex-1 overflow-y-auto p-2 space-y-2 scroll-smooth">
<!-- Notifications will be injected here -->
<div class="text-center text-gray-600 text-xs mt-10 italic">
AWAITING DATA STREAM...
</div>
</div>
</div>
</main>
<!-- Right Panel: Stats & Controls -->
<aside class="col-span-3 hud-border bg-cyber-panel p-3 flex flex-col gap-4">
<div class="text-sm font-bold text-cyber-magenta mb-2 border-b border-cyber-magenta/30 pb-1">
// METRICS
</div>
<!-- Real-time Graphs (Simulated with HTML bars) -->
<div class="space-y-4">
<div>
<div class="flex justify-between text-xs mb-1">
<span class="text-gray-400">THROUGHPUT</span>
<span id="tput-val" class="text-cyber-cyan">0 req/s</span>
</div>
<div class="h-2 bg-gray-900 border border-gray-700 relative">
<div id="tput-bar" class="h-full bg-cyber-cyan/50 transition-all duration-300 w-0"></div>
</div>
</div>
<div>
<div class="flex justify-between text-xs mb-1">
<span class="text-gray-400">LATENCY</span>
<span id="latency-val" class="text-cyber-magenta">0ms</span>
</div>
<div class="h-2 bg-gray-900 border border-gray-700 relative">
<div id="latency-bar" class="h-full bg-cyber-magenta/50 transition-all duration-300 w-0"></div>
</div>
</div>
</div>
<!-- Budget Controls -->
<div class="mt-auto border-t border-cyber-amber/30 pt-4">
<div class="text-xs text-cyber-amber mb-2">BUDGET_CONTROL</div>
<div class="grid grid-cols-2 gap-2">
<button id="budget-recharge" class="text-xs bg-cyber-amber/10 border border-cyber-amber text-cyber-amber hover:bg-cyber-amber hover:text-black py-1 px-2 transition">
RECHARGE[+20]
</button>
<button id="budget-lock" class="text-xs bg-cyber-amber/10 border border-cyber-amber text-cyber-amber hover:bg-red-500 hover:text-white py-1 px-2 transition">
LOCK_SYSTEM
</button>
</div>
<div class="mt-2 flex items-center gap-2">
<input type="range" id="budget-slider" min="10" max="200" value="100" class="flex-1 h-1 bg-gray-700 appearance-none">
<span id="slider-val" class="text-xs w-8 text-right">100</span>
</div>
</div>
</aside>
</div>
<!-- Footer -->
<footer class="h-8 border-t border-cyber-cyan/30 flex items-center px-4 text-[10px] text-gray-500 justify-between">
<div>NODE_ID: <span class="text-cyber-cyan">NX-7F-2291</span></div>
<div>ENCRYPTION: <span class="text-cyber-magenta">AES-256-GCM</span></div>
<div>NETWORK: <span class="text-cyber-cyan">LATENCY_OPTIMIZED</span></div>
</footer>
</div>
<!-- Scripts -->
<script>
// --- Configuration & State ---
const CONFIG = {
budget: { used: 0, limit: 100, max: 200 },
channels: {
push: { active: false, color: 'cyan' },
sse: { active: false, color: 'magenta' }
},
decodingSpeed: 30, // ms per char
feedLimit: 50, // max visible notifications
};
const DOM = {
clock: document.getElementById('clock'),
pushDot: document.getElementById('push-dot'),
sseDot: document.getElementById('sse-dot'),
pushInd: document.getElementById('push-indicator'),
sseInd: document.getElementById('sse-indicator'),
budgetArc: document.getElementById('budget-arc'),
budgetText: document.getElementById('budget-text'),
budgetPulse: document.getElementById('budget-pulse'),
budgetLimit: document.getElementById('budget-limit'),
feed: document.getElementById('notification-feed'),
sysLog: document.getElementById('sys-log'),
tputVal: document.getElementById('tput-val'),
tputBar: document.getElementById('tput-bar'),
latVal: document.getElementById('latency-val'),
latBar: document.getElementById('latency-bar'),
budgetSlider: document.getElementById('budget-slider'),
sliderVal: document.getElementById('slider-val'),
rechargeBtn: document.getElementById('budget-recharge'),
lockBtn: document.getElementById('budget-lock'),
clearBtn: document.getElementById('clear-btn'),
sysStatus: document.getElementById('sys-status')
};
// --- Clock ---
function updateClock() {
const now = new Date();
const ms = String(now.getMilliseconds()).padStart(3, '0');
DOM.clock TextContent = now.toLocaleTimeString('en-GB', { hour12: false }) + `:${ms}`;
}
setInterval(updateClock, 10);
updateClock();
// --- Three.js Background ---
const initThree = () => {
const container = document.getElementById('canvas-container');
const scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x050505, 0.002);
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.z = 30;
const renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(window.devicePixelRatio);
container.appendChild(renderer.domElement);
// Create a complex wireframe geometry (Icosahedron)
const geometry = new THREE.IcosahedronGeometry(15, 2);
const wireframe = new THREE.WireframeGeometry(geometry);
const lineMaterial = new THREE.LineBasicMaterial({ color: 0x00f3ff, transparent: true, opacity: 0.15 });
const sphereLines = new THREE.LineSegments(wireframe, lineMaterial);
scene.add(sphereLines);
// Add particles around
const particlesGeom = new THREE.BufferGeometry();
const particleCount = 1000;
const posArray = new Float32Array(particleCount * 3);
for(let i=0; i<particleCount * 3; i++) {
posArray[i] = (Math.random() - 0.5) * 80;
}
particlesGeom.setAttribute('position', new THREE.BufferAttribute(posArray, 3));
const particlesMat = new THREE.PointsMaterial({
size: 0.15,
color: 0xff00ff,
transparent: true,
opacity: 0.6
});
const particleMesh = new THREE.Points(particlesGeom, particlesMat);
scene.add(particleMesh);
// Animation loop
const animate = () => {
requestAnimationFrame(animate);
sphereLines.rotation.y += 0.001;
sphereLines.rotation.x += 0.0005;
particleMesh.rotation.y -= 0.0005;
renderer.render(scene, camera);
};
animate();
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
};
initThree();
// --- Decoding Effect ---
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$#@%&';
function decodeText(element, finalText, speed = CONFIG.decodingSpeed) {
let iterations = 0;
const interval = setInterval(() => {
element.innerText = finalText
.split('')
.map((char, index) => {
if (index < iterations) {
return finalText[index];
} else {
return chars[Math.floor(Math.random() * chars.length)];
}
})
.join('');
if (iterations >= finalText.length) {
clearInterval(interval);
}
iterations += 1 / 2; // reveal speed
}, speed);
}
// --- UI Updates ---
function updateBudgetUI() {
const percent = Math.min((CONFIG.budget.used / CONFIG.budget.limit) * 100, 100);
DOM.budgetText.innerText = Math.floor(percent) + '%';
// SVG stroke dasharray: 100 is circumference of radius 15.9 approx 100.
DOM.budgetArc.setAttribute('stroke-dasharray', `${percent} 100`);
// Color shift based on usage
let color = 'rgba(0, 243, 255, 0.8)'; // cyan
if (percent > 75) color = 'rgba(255, 170, 0, 0.8)'; // amber
if (percent > 90) color = 'rgba(255, 0, 255, 0.8)'; // magenta
if (percent >= 100) color = 'rgba(255, 50, 50, 0.8)'; // red
DOM.budgetArc.setAttribute('stroke', color);
DOM.budgetPulse.style.borderColor = color;
}
function setChannelActive(channel, isActive) {
if (channel === 'push') {
CONFIG.channels.push.active = isActive;
DOM.pushDot.style.opacity = isActive ? '1' : '0';
DOM.pushInd.style.width = isActive ? '100%' : '0%';
DOM.pushInd.style.backgroundColor = isActive ? 'rgba(0,243,255,0.6)' : 'transparent';
} else {
CONFIG.channels.sse.active = isActive;
DOM.sseDot.style.opacity = isActive ? '1' : '0';
DOM.sseInd.style.width = isActive ? '100%' : '0%';
DOM.sseInd.style.backgroundColor = isActive ? 'rgba(255,0,255,0.6)' : 'transparent';
}
}
// Initialize active push as default
setChannelActive('push', true);
// --- Notification System ---
class NotificationItem {
constructor(type = 'push') {
this.id = Date.now() + Math.random();
this.type = type;
this.timestamp = new Date();
this.msg = this.generateRandomMessage();
}
generateRandomMessage() {
const templates = [
{ type: 'SEC', text: 'Unauthorized access attempt on sector 7' },
{ type: 'SYS', text: 'Core processor temperature spike detected' },
{ type: 'NET', text: 'New handshake established from 10.0.0.45' },
{ type: 'DAT', text: 'Upload complete: data_packet_3342.bin' },
{ type: 'WAR', text: 'Firewall breach containment protocol initiated' },
{ type: 'INF', text: 'Scheduled maintenance in 15 minutes' },
{ type: 'USR', text: 'User_request_override from terminal 12' }
];
const t = templates[Math.floor(Math.random() * templates.length)];
return { ...t, channel: this.type };
}
getDOMElement() {
const div = document.createElement('div');
const isCyan = this.type === 'push';
const colorClass = isCyan ? 'border-cyber-cyan/50 hover:border-cyber-cyan' : 'border-cyber-magenta/50 hover:border-cyber-magenta';
const textColor = isCyan ? 'text-cyber-cyan' : 'text-cyber-magenta';
const shadow = isCyan ? 'shadow-neon-cyan' : 'shadow-neon-magenta';
div.className = `relative p-3 mb-2 bg-black/60 border ${colorClass} notification-enter backdrop-blur-sm transition-all duration-300 cursor-pointer group`;
div.dataset.id = this.id;
div.innerHTML = `
<div class="flex justify-between items-start">
<div class="flex-1">
<div class="flex items-center gap-2">
<span class="text-[10px] font-bold ${textColor} border border-current px-1">${this.msg.channel}</span>
<span class="text-[10px] text-gray-500 font-mono" id="time-${this.id}">00:00:00.000</span>
</div>
<div class="mt-2 font-mono text-sm tracking-tight decode-target ${textColor}" data-final="${this.msg.text}"></div>
</div>
<button class="opacity-0 group-hover:opacity-100 text-xs text-white hover:text-red-500 transition ml-2"><svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>
</div>
<div class="absolute top-0 right-0 w-2 h-2 ${textColor} animate-ping"></div>
`;
// Setup decode
const decodeEl = div.querySelector('.decode-target');
setTimeout(() => decodeText(decodeEl, this.msg.text, 20), 100 + Math.random() * 500);
// Set time
const timeEl = div.querySelector(`#time-${this.id}`);
const ms = String(this.timestamp.getMilliseconds()).padStart(3, '0');
const timeStr = this.timestamp.toLocaleTimeString('en-GB', { hour12: false }) + `.${ms}`;
timeEl.innerText = timeStr;
// Dismiss interaction
const dismissBtn = div.querySelector('button');
dismissBtn.onclick = (e) => {
e.stopPropagation();
this.dismiss(div);
};
div.onclick = () => {
// Simulate opening details
console.log('Open detail:', this.msg);
};
return div;
}
dismiss(element) {
element.classList.add('glitch-dissolve');
setTimeout(() => {
element.remove();
// Recycle max feed length
const feed = DOM.feed;
if (feed.children.length > CONFIG.feedLimit) {
feed.removeChild(feed.firstElementChild);
}
}, 200);
}
}
// --- Budget Management ---
function adjustBudget(amount) {
CONFIG.budget.used = Math.min(Math.max(0, CONFIG.budget.used + amount), CONFIG.budget.limit);
updateBudgetUI();
}
function budgetRecharge() {
adjustBudget(-20); // reduce used, effectively add capacity
logSys('BUDGET RECHARGED MANUAL +20 CAP');
}
DOM.rechargeBtn.addEventListener('click', budgetRecharge);
function budgetSliderChange(e) {
const val = parseInt(e.target.value);
CONFIG.budget.limit = val;
DOM.sliderVal.innerText = val;
DOM.budgetLimit.innerText = val;
updateBudgetUI();
}
DOM.budgetSlider.addEventListener('input', budgetSliderChange);
// --- Simulator ---
let tput = 0;
let latency = 0;
function logSys(msg) {
const el = document.createElement('div');
el.className = 'border-l-2 border-cyber-cyan pl-2';
el.innerText = `[${new Date().toLocaleTimeString('en-GB')}] ${msg}`;
DOM.sysLog.prepend(el);
if (DOM.sysLog.children.length > 20) DOM.sysLog.removeChild(DOM.sysLog.lastChild);
}
function simulateNotification() {
// Calculate budget availability
if (CONFIG.budget.used >= CONFIG.budget.limit) {
// Throttle: maybe only critical
if (Math.random() > 0.1) {
// ignore
tput++;
return;
}
}
// Determine channel: randomly choose, but simulate 30% push failure to demonstrate SSD fallback
let channel = Math.random() > 0.3 ? 'push' : 'sse';
// Simulate failure of push
if (channel === 'push' && Math.random() < 0.2) {
channel = 'sse';
logSys('WEB_PUSH HANDHELD FAILED // FALLBACK TO SSE');
}
// Update UI channel state
setChannelActive(channel, true);
// Keep other channel lit for 1s before fading? For now just show active.
// Create Notification
const notif = new NotificationItem(channel);
const dom = notif.getDOMElement();
DOM.feed.appendChild(dom);
// Auto scroll
DOM.feed.scrollTop = DOM.feed.scrollHeight;
// Update metrics
adjustBudget(1);
// Synthetic metrics
tput = Math.floor(Math.random() * 5) + 10;
latency = Math.floor(Math.random() * 40) + 20;
DOM.tputVal.innerText = tput + ' req/s';
DOM.tputBar.style.width = Math.min(tput * 2, 100) + '%';
DOM.latVal.innerText = latency + 'ms';
DOM.latBar.style.width = latency * 2 + '%'; // scaled for demo
// Randomly switch channel off if no recent activity of that type
setTimeout(() => {
if (channel === 'push' && Math.random() > 0.5) setChannelActive('push', false);
if (channel === 'sse' && Math.random() > 0.5) setChannelActive('sse', false);
}, 2000);
}
// --- Init ---
DOM.budgetLimit.innerText = CONFIG.budget.limit;
updateBudgetUI();
// Start loops
setInterval(() => {
simulateNotification();
}, 1500);
// Clear purge
DOM.clearBtn.addEventListener('click', () => {
DOM.feed.innerHTML = '';
logSys('QUEUE PURGED MANUAL');
});
// --- Glitch Canvas Effect on Hover (overlay CSS) ---
document.addEventListener('mousemove', (e) => {
// Could implement tracers, but we have CSS cursor.
});
</script>
</body>
</html>