-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.js
43 lines (35 loc) · 975 Bytes
/
about.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
34
35
36
37
38
39
40
41
42
43
const menukill = () => {
const mobilenav = document.getElementById('mobilenav');
if (mobilenav) {
mobilenav.style.width = '0';
}
const main = document.getElementById('main');
if (main) {
main.style.marginLeft = '0';
}
document.body.style.backgroundColor = 'rgba(255, 255, 255, 1)';
};
const closeMenu = () => {
menukill();
};
const menuopen = () => {
const mobilenav = document.getElementById('mobilenav');
if (mobilenav) {
mobilenav.style.width = '100%';
}
const main = document.getElementById('main');
if (main) {
main.style.marginLeft = '250px';
}
document.body.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
};
const menuToggle = document.getElementById('menu-toggle');
if (menuToggle) {
menuToggle.addEventListener('click', menuopen);
}
const closeMenuLinks = document.querySelectorAll('.close-menu');
if (closeMenuLinks) {
closeMenuLinks.forEach((link) => {
link.addEventListener('click', closeMenu);
});
}