-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
60 lines (49 loc) · 1.83 KB
/
script.js
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
AOS.init();
window.addEventListener("load", function(event){
let data = new Date();
let anoAtual = data.getFullYear();
var copyright = document.querySelector(".copyright");
copyright.innerHTML = "© " + anoAtual + " - Dev Ficar Bonito Barberia - Todos os direitos reservados.";
});
function toggleTheme(theme) {
const htmlElement = document.documentElement;
const logos = document.querySelectorAll('.logo');
const presente = document.querySelector('.presente');
htmlElement.setAttribute('data-theme', theme);
logos.forEach((logo) => {
if (htmlElement.getAttribute('data-theme') == 'dark') {
logo.src = 'assets/logo-light.svg';
} else if (htmlElement.getAttribute('data-theme') == 'light') {
logo.src = 'assets/logo-dark.svg';
}
});
if (htmlElement.getAttribute('data-theme') == 'dark') {
presente.src = 'assets/presente-vermelho.png';
} else if (htmlElement.getAttribute('data-theme') == 'light') {
presente.src = 'assets/presente-preto.png';
}
}
document.addEventListener('DOMContentLoaded', function() {
const themeButtons = document.querySelectorAll('.theme-button');
themeButtons.forEach(button => {
button.addEventListener('click', function() {
const selectedTheme = this.dataset.theme;
toggleTheme(selectedTheme);
});
});
});
window.addEventListener("load", function(event){
const promo = document.querySelector('.promo');
const convite = document.querySelector('.convite');
setTimeout(() => {
promo.style.left = '25px';
}, 5000);
setTimeout(() => {
convite.style.left = '150px';
convite.style.opacity = '1';
}, 8000);
setTimeout(() => {
convite.style.left = '0';
convite.style.opacity = '0';
}, 16000);
});