const floatParticles = [];
const burstParticles = [];
const FLOAT_COUNT = 140;
for (let i = 0; i < FLOAT_COUNT ; i++) {
const p = new Particle(
Math.random() * width, Math.random() * height, "float");
p.Life = Math.random() * p.maxLife;// stagger starting life
floatParticles.push(p);
}
function spawnHeartBurst(x, y) {
const count = 140;
for (let i = 0; i < count; i++) {
burstParticles.push(new Particle(x, y, "burst"));
}
}
const BLUE_SHADES = [
"#3b82f6", "#60a5fa", // blue-400
"#93c5fd", "#2563eb", // blue-600
"#bfdbfe", "#1d4ed8", // blue-700
];
To embed this project on your website, copy the following code and paste it into your website's HTML: