Cap ambient particles to five concurrently
This commit is contained in:
parent
71174e8477
commit
9cd43d8c67
@ -410,6 +410,8 @@ function scheduleAmbientDrift() {
|
|||||||
const delay = 10000 + Math.random() * 10000; // 10–20s
|
const delay = 10000 + Math.random() * 10000; // 10–20s
|
||||||
fireflyTimer = setTimeout(() => {
|
fireflyTimer = setTimeout(() => {
|
||||||
if (!animationsEnabled) { stopAmbientDrift(); return; }
|
if (!animationsEnabled) { stopAmbientDrift(); return; }
|
||||||
|
const existing = document.querySelectorAll(isDarkMode ? '.firefly-wrap' : '.seed-wrap').length;
|
||||||
|
if (existing >= 5) { scheduleAmbientDrift(); return; }
|
||||||
if (isDarkMode) {
|
if (isDarkMode) {
|
||||||
spawnFirefly();
|
spawnFirefly();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user