-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
98 lines (86 loc) · 3.24 KB
/
app.js
File metadata and controls
98 lines (86 loc) · 3.24 KB
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
const harmburger = document.querySelector('.image1');
const closeIcon = document.querySelector('.image2');
const img = document.querySelectorAll('.img');
const img1 = document.querySelectorAll('.img1');
const nav = document.querySelector('nav');
const firstHeader = document.querySelector('header.head');
const secondHeader = document.querySelector('header.head1');
const p = document.querySelectorAll('.par');
const div = document.querySelector('.nav-links');
const aLinks = document.querySelector('.nav-links').children;
const firstDropdown = document.querySelector('a.dropdownf');
const secondDropdown = document.querySelector('a.dropdowns');
const thirdDropdown = document.querySelector('a.dropdownt');
const firstDisplay = document.querySelector('section.section3.simple');
const secondDisplay = document.querySelector('section.section3.speedy');
const thirdDisplay = document.querySelector('section.section3.easy');
harmburger.addEventListener('click', function(){
harmburger.classList.add('display1');
harmburger.classList.remove('active')
closeIcon.classList.add('active');
closeIcon.classList.remove('display1');
div.classList.add('showLinks');
div.classList.remove('display1');
nav.classList.add('navBackground')
firstHeader.classList.add('display1')
secondHeader.classList.remove('display1')
if(div){
for(let i = 0; i < aLinks.length; i++){
aLinks[i].classList.add('a');
}
}else{
for(let i = 0; i < aLinks.length; i++){
aLinks[i].classList.remove('a');
}
}
})
closeIcon.addEventListener('click', function(){
harmburger.classList.remove('display1');
harmburger.classList.add('active');
closeIcon.classList.add('display1');
closeIcon.classList.remove('active');
div.classList.remove('showLinks');
div.classList.add('display1');
nav.classList.remove('navBackground');
firstHeader.classList.remove('display1')
secondHeader.classList.add('display1')
})
firstDropdown.addEventListener('click', function(){
firstDisplay.style.display = "inline-flex"
secondDisplay.style.display = "none"
thirdDisplay.style.display = "none"
})
secondDropdown.addEventListener('click', function(){
firstDisplay.style.display = "none"
secondDisplay.style.display = "inline-flex"
thirdDisplay.style.display = "none"
})
thirdDropdown.addEventListener('click', function(){
firstDisplay.style.display = "none"
secondDisplay.style.display = "none"
thirdDisplay.style.display = "inline-flex"
})
for(let i = 0; i < img.length; i++){
img[i].addEventListener('click', () => {
img[i].classList.add('display1')
for(let j = 0; j < img1.length; j++){
img1[i].classList.remove('display1')
}
for(let k = 0; k < p.length; k++){
p[i].classList.remove('display1')
p[i].classList.add('align')
}
})
}
for(let i = 0; i < img1.length; i++){
img1[i].addEventListener('click', () => {
img1[i].classList.add('display1')
for(let j = 0; j < img.length; j++){
img[i].classList.remove('display1')
}
for(let k = 0; k < p.length; k++){
p[i].classList.add('display1')
p[i].classList.remove('align')
}
})
}