-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
30 lines (21 loc) · 755 Bytes
/
script.js
File metadata and controls
30 lines (21 loc) · 755 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
28
29
30
function toggleMode(){
const html = document.documentElement;
html.classList.toggle('light');
}
const img = document.querySelector("profile img");
if (html.classList.contains("light"))
{
img.setAttribute("src","./assets/avatar-light.png");
} else {
img.setAttribute("src","./assets/avatar.png");
}
function toggleMode() {
const html = document.documentElement;
const img = document.querySelector("#profile img");
html.classList.toggle('light');
if (html.classList.contains("light")) {
img.setAttribute("src", "./assets/avatar-light.png");
} else {
img.setAttribute("src", "./assets/avatar.png");
}
}