Limit seeds to spawn from top/left/right

This commit is contained in:
chris 2025-12-10 16:05:48 -05:00
parent 29718539d1
commit 7865d8e772

View File

@ -375,11 +375,20 @@ function spawnSeed({ markActive = false, source = 'ambient' } = {}) {
const tilt = (Math.random() * 16 + 8) * (Math.random() < 0.5 ? -1 : 1); // +/-824deg
const sway = 4 + Math.random() * 6; // px
const flipDur = 5 + Math.random() * 4; // 59s
const fromLeft = Math.random() < 0.5;
const start = fromLeft ? '-12vw' : '112vw';
const mid = fromLeft ? '30vw' : '-30vw';
const end = fromLeft ? '112vw' : '-12vw';
wrap.style.top = `${top}vh`;
const dir = ['left','right','top'][Math.floor(Math.random()*3)];
const fromLeft = dir === 'left';
let start = fromLeft ? '-12vw' : '112vw';
let mid = fromLeft ? '30vw' : '-30vw';
let end = fromLeft ? '112vw' : '-12vw';
if (dir === 'top') {
const x = Math.random()*80 + 10;
start = `${x}vw`;
mid = `${x + (Math.random()*10 - 5)}vw`;
end = `${x + (Math.random()*20 - 10)}vw`;
wrap.style.top = '-12vh';
} else {
wrap.style.top = `${top}vh`;
}
wrap.style.setProperty('--seed-scale', scale);
wrap.style.setProperty('--seed-duration', `${duration}s`);
wrap.style.setProperty('--seed-tilt', `${tilt}deg`);