generated from oovillagran/Templateok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.js
34 lines (31 loc) · 1.22 KB
/
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
// hamburguer menu
const hamburger = document.querySelector('.hamburger');
const navMenu = document.querySelector('.nav-menu');
const navBarMenu = document.querySelector('.navbar-menu');
const logo = document.querySelector('.logo');
const main = document.querySelector('.main');
const footer = document.querySelector('.footer-about');
const closeButton = document.createElement('button');
const body = document.querySelector('body');
hamburger.addEventListener('click', () => {
closeButton.classList.add('xButton');
navMenu.appendChild(closeButton);
hamburger.classList.toggle('active');
navMenu.classList.toggle('active');
navBarMenu.classList.add('display');
logo.classList.add('hidden');
main.classList.toggle('active');
footer.classList.toggle('active');
body.classList.add('overFlow');
const closeButtonAction = document.querySelector('.xButton');
closeButtonAction.addEventListener('click', () => {
window.location.reload();
});
});
document.querySelectorAll('.link-menu').forEach((m) => m.addEventListener('click', () => {
hamburger.classList.remove('active');
navMenu.classList.remove('active');
main.classList.remove('active');
footer.classList.remove('active');
body.classList.remove('overFlow');
}));