edit particles
This commit is contained in:
14
js/main.js
14
js/main.js
@ -39,13 +39,19 @@ function createParticle() {
|
||||
if (Math.random() > 0.6) particle.classList.add('large');
|
||||
particle.style.left = `${Math.random() * 100}%`;
|
||||
particle.style.top = `${Math.random() * 100}%`;
|
||||
particle.style.animationDelay = `${Math.random() * 10}s`;
|
||||
particle.style.animationDuration = `${10 + Math.random() * 8}s`;
|
||||
particle.style.animationDelay = `${Math.random() * 8}s`;
|
||||
particle.style.animationDuration = `${8 + Math.random() * 6}s`;
|
||||
document.body.appendChild(particle);
|
||||
setTimeout(() => particle.remove(), 18000);
|
||||
// Remove particle with fade-out effect
|
||||
setTimeout(() => {
|
||||
particle.classList.add('fade-out');
|
||||
// Wait for fade-out animation to complete before removing
|
||||
setTimeout(() => particle.remove(), 500);
|
||||
}, 14000);
|
||||
}
|
||||
|
||||
setInterval(createParticle, 500);
|
||||
// Create particles frequently
|
||||
setInterval(createParticle, 50);
|
||||
|
||||
function throttle(fn, wait) {
|
||||
let lastTime = 0;
|
||||
|
Reference in New Issue
Block a user