-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (19 loc) · 716 Bytes
/
script.js
File metadata and controls
21 lines (19 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function toggleMode() {
const html = document.documentElement
html.classList.toggle("light")
// Switch profile image
const profileImg = document.querySelector("#profile img")
if (html.classList.contains("light")) {
profileImg.setAttribute("src", "./assets/avatar-light.png")
profileImg.setAttribute(
"alt",
"Davi Nakano's picture making a hang loose gesture while wearing upside down red sunglasses, an ugly christmas sweater and eating a lollipop."
)
} else {
profileImg.setAttribute("src", "./assets/avatar.png")
profileImg.setAttribute(
"alt",
"Davi Nakano's picture smiling and facing forward wearing a plaid shirt with a blurple background"
)
}
}