-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
23 lines (20 loc) · 760 Bytes
/
script.js
File metadata and controls
23 lines (20 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let isNoite = true; // Estado inicial
function toogleDayMode() {
const sky = document.querySelector('.sky');
const windows = document.querySelectorAll('.window');
const moon = document.querySelector('.moon');
const luz1 = document.querySelector('.luz1');
const luz2 = document.querySelector('.luz2');
if (isNoite) {
// Muda para noite
sky.classList.remove('skyDay');
windows.forEach(window => window.classList.remove('windowDay'));
moon.classList.remove('sun');
} else {
// Muda para dia
sky.classList.add('skyDay');
moon.classList.add('sun');
windows.forEach(window => window.classList.add('windowDay'));
}
isNoite = !isNoite;
}