Particles: 0
FPS: 0
Seed: 0
Frame: 0
`; const blob = new Blob([html], { type: 'text/html' }); const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.download = `flow-field-bg-${seed}.html`; link.href = url; link.click(); URL.revokeObjectURL(url); }); // Resize handler let resizeTimer; window.addEventListener('resize', () => { resize(); clearCanvas(); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { initParticles(); }, 150); }); // Keyboard shortcuts — only toggle pause when no other button/input is focused document.addEventListener('keydown', (e) => { if (e.code === 'Space') { const tag = document.activeElement?.tagName; if (tag === 'BUTTON' || tag === 'INPUT' || tag === 'SELECT') return; e.preventDefault(); document.getElementById('btnPlayPause').click(); } }); updatePalettePreview(); requestAnimationFrame(loop); } init(); })();