-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
110 lines (79 loc) · 3.24 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const swiper = new Swiper('.swiper', {
// Optional parameters
// loop: true,
parallax: true,
speed: 1000,
keyboard: {
enabled: true,
},
// If we need pagination
pagination: {
el: '.slider-controls__count',
type: 'fraction',
},
// Navigation arrows
navigation: {
nextEl: '#sliderNext',
prevEl: '#sliderPrev',
},
// And if we need scrollbar
scrollbar: {
el: '.swiper-scrollbar',
},
});
// document.querySelector('.nav-burger').addEventListener('click', function () {
// this.classList.toggle('active');
// document.querySelector('.mobile-nav').classList.toggle('open');
// document.querySelector('.mobile-nav-overlay').classList.toggle('open');
// document.querySelector('.mobile-nav__nav').classList.toggle('active');
// document.querySelector('.mobile-nav__nav-burger').classList.toggle('active');
// });
var burgerOpen = document.querySelector('.nav-burger');
burgerOpen.addEventListener('click', openOnClick);
function openOnClick() {
burgerOpen.classList.toggle('active');
document.querySelector('.mobile-nav').classList.toggle('open');
document.querySelector('.mobile-nav-overlay').classList.toggle('open');
document.querySelector('.mobile-nav__nav').classList.toggle('active');
document.querySelector('.mobile-nav__nav-burger').classList.toggle('active');
var burgerClose = document.querySelector('.mobile-nav__nav-burger.active');
burgerClose.addEventListener('click', closeOnClick);
function closeOnClick() {
burgerClose.classList.remove('active');
document.querySelector('.nav-burger.active').classList.remove('active');
document.querySelector('.mobile-nav.open').classList.remove('open');
document.querySelector('.mobile-nav-overlay.open').classList.remove('open');
document.querySelector('.mobile-nav__nav.active').classList.remove('active');
document.querySelector('.mobile-nav__nav-burger.active').classList.remove('active');
};
};
// document.querySelector('.nav-burger').addEventListener('click', function () {
// this.classList.toggle('active');
// document.querySelector('.mobile-nav').classList.toggle('open');
// document.querySelector('.mobile-nav-overlay').classList.toggle('open');
// document.querySelector('.mobile-nav__nav').classList.toggle('active');
// });
// document.querySelector('.mobile-nav__nav-burger').classList.toggle('active');
// const navBtnClose = document.querySelector('.mobile-nav__nav-burger');
// navBtnClose.onclick = ReturnAll;
// function ReturnAll() {return};
// });
// const menuBtn = document.querySelector(".nav-burger");
// const menuItems = document.querySelector(".mobile-nav");
// const menuScreen = document.querySelectorAll(".mobile-nav-overlay");
// const menuItem = document.querySelector(".mobile-nav__nav-burger");
// function toggle() {
// menuBtn.classList.toggle("open");
// menuItems.classList.toggle("open");
// menuScreen.classList.toggle("open");
// }
// menuBtn.addEventListener("click", () => {
// toggle();
// })
// menuItem.forEach(item => {
// item.addEventListener("click", () => {
// if (menuBtn.classList.contains("open")) {
// toggle();
// }
// });
// });