-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (39 loc) · 1.62 KB
/
Copy pathscript.js
File metadata and controls
52 lines (39 loc) · 1.62 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
function updateTimer() {
const startDate = new Date("2022-05-22T00:00:00");
const now = new Date();
const diff = now - startDate;
const years = now.getFullYear() - startDate.getFullYear();
const months = now.getMonth() - startDate.getMonth() + (years * 12);
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff / (1000 * 60 * 60)) % 24);
const minutes = Math.floor((diff / (1000 * 60)) % 60);
const seconds = Math.floor((diff / 1000) % 60);
document.getElementById("timer").innerText =
`${Math.floor(days/365)} anos, ${months % 12} meses, ${days % 30} dias, ${hours} horas, ${minutes} minutos e ${seconds} segundos`;
}
setInterval(updateTimer, 1000);
updateTimer();
function createHeart() {
const heart = document.createElement("div");
heart.className = "heart";
heart.style.left = Math.random() * 100 + "vw";
document.getElementById("hearts-container").appendChild(heart);
setTimeout(() => heart.remove(), 5000);
}
setInterval(createHeart, 300);
// Gerar corações roxos caindo
setInterval(() => {
const heart = document.createElement('div');
heart.classList.add('heart');
heart.style.left = Math.random() * 100 + "vw";
heart.style.animationDuration = 3 + Math.random() * 3 + "s";
document.querySelector('.hearts-container').appendChild(heart);
setTimeout(() => {
heart.remove();
}, 6000);
}, 300);
// Mostrar conteúdo principal após clique
document.getElementById('enter-button').addEventListener('click', () => {
document.getElementById('intro-screen').style.display = 'none';
document.getElementById('main-content').style.display = 'block';
});