Cap ambient particles to five concurrently

This commit is contained in:
chris 2025-12-10 15:57:41 -05:00
parent 71174e8477
commit 9cd43d8c67

View File

@ -410,6 +410,8 @@ function scheduleAmbientDrift() {
const delay = 10000 + Math.random() * 10000; // 1020s
fireflyTimer = setTimeout(() => {
if (!animationsEnabled) { stopAmbientDrift(); return; }
const existing = document.querySelectorAll(isDarkMode ? '.firefly-wrap' : '.seed-wrap').length;
if (existing >= 5) { scheduleAmbientDrift(); return; }
if (isDarkMode) {
spawnFirefly();
} else {