-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
28 lines (23 loc) · 1.07 KB
/
app.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
(function () {
[...document.querySelectorAll(".control")].forEach(button => {
button.addEventListener("click", function() {
document.querySelector(".active-btn").classList.remove("active-btn");
this.classList.add("active-btn");
document.querySelector(".active").classList.remove("active");
document.getElementById(button.dataset.id).classList.add("active");
})
});
document.querySelector(".theme-btn").addEventListener("click", () => {
document.body.classList.toggle("light-mode");
})
})();
document.querySelectorAll(".view-resume").forEach(ele => {
ele.addEventListener("click", function() {
document.querySelectorAll(".control").forEach(button => {
document.querySelector(".active-btn").classList.remove("active-btn");
document.getElementsByClassName("ctrl-res")[0].classList.add("active-btn");
document.querySelector(".active").classList.remove("active");
document.getElementById("resume").classList.add("active");
})
})
});