-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (23 loc) · 738 Bytes
/
script.js
File metadata and controls
27 lines (23 loc) · 738 Bytes
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
function toggleMode() {
const html = document.documentElement
html.classList.toggle("light")
// pegar a tag img
const img = document.querySelector("#profile img")
// substituir a imagem
if (html.classList.contains("light")) {
// se tiver light mode, adicionar a imagem light
img.setAttribute("src", "./assets/logo-dark.png")
} else {
// set tiver sem light mode, manter a imagem normal
img.setAttribute("src", "./assets/logo-light.png")
}
}
let current = 0;
const reviews = document.querySelectorAll(".review");
function showReview() {
reviews.forEach((rev, i) => {
rev.classList.toggle("active", i === current);
});
current = (current + 1) % reviews.length;
}
setInterval(showReview, 4000);