-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
44 lines (35 loc) · 1.18 KB
/
main.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
44
const menuMobile = document.querySelector('.menu-mobile');
const menuBtn = document.querySelector('.menu-btn');
let menuOpen = false;
menuBtn.addEventListener('click', () => {
if (!menuOpen) {
menuBtn.classList.add('open');
menuMobile.classList.remove('oculto');
menuOpen = true;
} else {
menuBtn.classList.remove('open');
menuMobile.classList.add('oculto');
menuOpen = false;
}
});
// //menú responsive
// const menuMobile = document.querySelector('.menu-mobile');
// //hamburger button animation
// const menuBtn = document.querySelector('.menu-btn');
// let menuOpen = false;
// menuBtn.addEventListener('click', () => {
// if (!menuOpen) {
// menuBtn.classList.add('open');
// // menuMobile.classList.add('h-full')
// menuMobile.classList.remove('top-[-100%]')
// menuOpen = true;
// } else {
// menuBtn.classList.remove('open');
// // menuMobile.classList.remove('h-full')
// menuMobile.classList.add('top-[-100%]')
// menuOpen = false;
// }
// })
// menuBtn.addEventListener('click', () => {
// menuMobile.classList.toggle('transition-all');
// });