Files
bgrollemanandClaude Opus 5.5 94832d861b Night Grid cyberpunk style guide
Spec, stylesheet, glitch script, Claude Code skill and the design
canvas source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:21:37 +01:00

16 lines
564 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Night Grid: glitch one random .ng-glitch element every 6–14s (~10s average).
(() => {
if (matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const next = () => setTimeout(tick, 6000 + Math.random() * 8000);
const tick = () => {
const els = document.querySelectorAll('.ng-glitch');
const el = els[Math.floor(Math.random() * els.length)];
if (el) {
el.classList.add('is-glitching');
el.addEventListener('animationend', () => el.classList.remove('is-glitching'), { once: true });
}
next();
};
next();
})();