/* =========================================================================
CISCO ARENA — Celebration overlay, Tweaks panel, Toasts
========================================================================= */
const { useState: _uS, useEffect: _uE, useMemo: _uM } = React;
function Celebration({ theme, streak, onDone }) {
// Respect reduced motion preference
const prefersReducedMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
_uE(() => {
const t = setTimeout(onDone, 2000);
return () => clearTimeout(t);
}, []);
const confetti = _uM(() => {
return Array.from({length: 60}).map((_, i) => {
const left = Math.random() * 100;
const dur = 1.4 + Math.random() * 1.1;
const delay = Math.random() * .4;
const colorPool = [
"var(--accent)", "var(--accent-2)", "var(--success)", "var(--warning)",
];
const bg = colorPool[i % colorPool.length];
const rot = Math.floor(Math.random() * 360);
const w = 6 + Math.floor(Math.random()*6);
const h = 10 + Math.floor(Math.random()*10);
return { left, dur, delay, bg, rot, w, h, i };
});
}, [theme.id]);
return (
{!prefersReducedMotion && (
{confetti.map(c => (
))}
)}
{theme.celebration.word}
{theme.celebration.sub}
STREAK × {streak}
);
}
function TweaksPanel({ open, onOpen, onClose, state, set }) {
if (!open) {
return (
);
}
return (
Theme pack5
{window.THEMES.map(t => (
))}
Mode
{["dark","light"].map(m => (
))}
Density
{[["compact","Compact"],["normal","Default"],["roomy","Roomy"]].map(([v,n]) => (
))}
Leaderboard layout
{[["rail","Rail"],["full","Full"],["ticker","Ticker"]].map(([v,n]) => (
))}
Celebration style
{[["fullbleed","Full-bleed"],["center","Center"],["toast","Corner"]].map(([v,n]) => (
))}
Demos
);
}
function Toasts({ toasts }) {
return (
);
}
window.Celebration = Celebration;
window.TweaksPanel = TweaksPanel;
window.Toasts = Toasts;