mirror of
https://github.com/kingomarnajjar/clock.git
synced 2026-07-25 22:27:31 +10:00
x
This commit is contained in:
parent
2ba5b0ae6f
commit
bd1490d627
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue