This commit is contained in:
Omar Najjar 2024-10-14 05:51:21 +11:00
parent 2ba5b0ae6f
commit bd1490d627

View file

@ -198,7 +198,7 @@
// Snow effect on click // Snow effect on click
document.body.addEventListener('click', (event) => { document.body.addEventListener('click', (event) => {
const duration = 10 * 1000; // Reduced duration const duration = 3 * 1000; // Reduced duration
const animationEnd = Date.now() + duration; const animationEnd = Date.now() + duration;
function randomInRange(min, max) { function randomInRange(min, max) {
@ -207,11 +207,11 @@
(function frame() { (function frame() {
const timeLeft = animationEnd - Date.now(), const timeLeft = animationEnd - Date.now(),
ticks = Math.max(100, 300 * (timeLeft / duration)); // Increased speed ticks = Math.max(50, 100 * (timeLeft / duration)); // Increased speed
// Create snow effect in a smaller area // Create snow effect in a smaller area
const offsetX = randomInRange(-50, 50); // +/- 50 pixels horizontally const offsetX = randomInRange(-10, 10); // +/- 50 pixels horizontally
const offsetY = randomInRange(-20, 20); // +/- 20 pixels vertically const offsetY = randomInRange(-10, 10); // +/- 20 pixels vertically
confetti({ confetti({
angle: randomInRange(55, 125), // Random angle for direction angle: randomInRange(55, 125), // Random angle for direction