-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
69 lines (61 loc) · 1.97 KB
/
Copy pathscripts.js
File metadata and controls
69 lines (61 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
window.onload = () => {
document.getElementById('loading').style.display = 'none';
document.getElementById('mainContent').style.display = 'block';
updateCountdownMessage();
};
function updateCountdownMessage() {
const now = new Date();
const deadline = new Date();
deadline.setHours(1, 0, 0, 0);
if (now > deadline) deadline.setDate(deadline.getDate() + 1);
const timeDiff = deadline - now;
const hours = Math.floor(timeDiff / (1000 * 60 * 60));
const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
document.getElementById("countdownMessage").textContent =
`Website will be put down later, enjoy while it lasts! Time left: ${hours}h ${minutes}m ${seconds}s . . .`;
}
setInterval(updateCountdownMessage, 1000);
const sound1 = new Audio('one.mp3');
const sound2 = new Audio('two.mp3');
function startFireworks() {
const duration = 3 * 1000;
const end = Date.now() + duration;
const colors = ['#a5d6a7', '#ffffff'];
(function frame() {
const randomSound = Math.random() > 0.5 ? sound1 : sound2;
randomSound.play();
confetti({
particleCount: 100,
angle: 60,
spread: 900,
origin: { x: 0 },
colors: colors
});
confetti({
particleCount: 100,
angle: 120,
spread: 900,
origin: { x: 1 },
colors: colors
});
confetti({
particleCount: 500,
angle: 90,
spread: 200,
startVelocity: 100,
origin: { x: 0.5, y: 0 },
colors: colors
});
confetti({
particleCount: 100,
angle: 360,
spread: 900,
origin: { x: 0.5, y: 0.5 },
colors: colors
});
if (Date.now() < end) {
requestAnimationFrame(frame);
}
}());
}