-
Notifications
You must be signed in to change notification settings - Fork 0
/
app2.js
33 lines (29 loc) · 1.04 KB
/
app2.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
29
30
31
32
33
// sidenav-profile
const sidenavProfile = document.querySelector(".profile");
const sidenavProfileModal = document.querySelector(".profile-modal");
sidenavProfile.addEventListener("mouseover", () => {
sidenavProfileModal.classList.remove("show-profile-modal");
});
sidenavProfile.addEventListener("mouseout", () => {
sidenavProfileModal.classList.add("show-profile-modal");
});
// phone background color
const bgPicker = document.getElementById("bg-picker");
const bgHex = document.getElementById("bg-hex");
const phone = document.querySelector(".phone");
bgPicker.addEventListener("input", () => {
const bgValue = bgPicker.value;
phone.style.backgroundColor = bgValue;
bgHex.value = bgValue;
});
bgHex.addEventListener("input", () => {
const bgValue = bgHex.value;
phone.style.backgroundColor = bgValue;
bgPicker.value = bgValue;
});
// mobile menu
const menuBar = document.querySelector(".menu-bar")
const menuModal = document.querySelector(".menu-modal")
menuBar.addEventListener("click", () => {
menuModal.classList.toggle("show-nav")
})