-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
167 lines (145 loc) · 5.46 KB
/
index.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// let overlay = document.getElementById('over');
// function removeOverlay(){
// overlay.classList.add('overlay-hidden');
// }
let menu = document.getElementById('menu');
let nav = document.getElementById('nav');
let cross = document.getElementById('cross');
menu.addEventListener('click', () => {
nav.classList.remove('nav-d-none');
})
cross.addEventListener('click', () => {
nav.classList.add('nav-d-none');
})
let drop1 = document.getElementById('dropdown1');
let drop2 = document.getElementById('dropdown2');
let drop3 = document.getElementById('dropdown3');
let drop4 = document.getElementById('dropdown4');
let para1 = document.getElementById('p1');
let para2 = document.getElementById('p2');
let para3 = document.getElementById('p3');
let para4 = document.getElementById('p4');
drop1.addEventListener('click', () => {
if(para1.dataset.open === 'false'){
para1.dataset.open = 'true';
para1.classList.remove('paragraph-hidden');
para1.classList.add('paragraph-hidden-end');
drop1.classList.add('flip-vertical');
} else {
para1.dataset.open = 'false';
para1.classList.add('paragraph-hidden');
para1.classList.remove('paragraph-hidden-end');
drop1.classList.remove('flip-vertical');
}
if(para2.dataset.open === 'true'){
para2.classList.add('paragraph-hidden');
para2.dataset.open = 'false';
para2.classList.remove('paragraph-hidden-end');
drop2.classList.remove('flip-vertical');
}
if(para3.dataset.open === 'true'){
para3.classList.add('paragraph-hidden');
para3.dataset.open = 'false';
para3.classList.remove('paragraph-hidden-end');
drop3.classList.remove('flip-vertical');
}
if(para4.dataset.open === 'true'){
para4.classList.add('paragraph-hidden');
para4.dataset.open = 'false';
para4.classList.remove('paragraph-hidden-end');
drop4.classList.remove('flip-vertical');
}
});
drop2.addEventListener('click', () => {
if(para2.dataset.open === 'false'){
para2.dataset.open = 'true';
para2.classList.remove('paragraph-hidden');
para2.classList.add('paragraph-hidden-end');
drop2.classList.add('flip-vertical');
} else {
para2.dataset.open = 'false';
para2.classList.add('paragraph-hidden');
para2.classList.remove('paragraph-hidden-end');
drop2.classList.remove('flip-vertical');
}
if(para1.dataset.open === 'true'){
para1.classList.add('paragraph-hidden');
para1.dataset.open = 'false';
para1.classList.remove('paragraph-hidden-end');
drop1.classList.remove('flip-vertical');
}
if(para3.dataset.open === 'true'){
para3.classList.add('paragraph-hidden');
para3.dataset.open = 'false';
para3.classList.remove('paragraph-hidden-end');
drop3.classList.remove('flip-vertical');
}
if(para4.dataset.open === 'true'){
para4.classList.add('paragraph-hidden');
para4.dataset.open = 'false';
para4.classList.remove('paragraph-hidden-end');
drop4.classList.remove('flip-vertical');
}
});
drop3.addEventListener('click', () => {
if(para3.dataset.open === 'false'){
para3.dataset.open = 'true';
para3.classList.remove('paragraph-hidden');
para3.classList.add('paragraph-hidden-end');
drop3.classList.add('flip-vertical');
} else {
para3.dataset.open = 'false';
para3.classList.add('paragraph-hidden');
para3.classList.remove('paragraph-hidden-end');
drop3.classList.remove('flip-vertical');
}
if(para2.dataset.open === 'true'){
para2.classList.add('paragraph-hidden');
para2.dataset.open = 'false';
para2.classList.remove('paragraph-hidden-end');
drop2.classList.remove('flip-vertical');
}
if(para1.dataset.open === 'true'){
para1.classList.add('paragraph-hidden');
para1.dataset.open = 'false';
para1.classList.remove('paragraph-hidden-end');
drop1.classList.remove('flip-vertical');
}
if(para4.dataset.open === 'true'){
para4.classList.add('paragraph-hidden');
para4.dataset.open = 'false';
para4.classList.remove('paragraph-hidden-end');
drop4.classList.remove('flip-vertical');
}
});
drop4.addEventListener('click', () => {
if(para4.dataset.open === 'false'){
para4.dataset.open = 'true';
para4.classList.remove('paragraph-hidden');
para4.classList.add('paragraph-hidden-end');
drop4.classList.add('flip-vertical');
} else {
para4.dataset.open = 'false';
para4.classList.add('paragraph-hidden');
para4.classList.remove('paragraph-hidden-end');
drop4.classList.remove('flip-vertical');
}
if(para2.dataset.open === 'true'){
para2.classList.add('paragraph-hidden');
para2.dataset.open = 'false';
para2.classList.remove('paragraph-hidden-end');
drop2.classList.remove('flip-vertical');
}
if(para3.dataset.open === 'true'){
para3.classList.add('paragraph-hidden');
para3.dataset.open = 'false';
para3.classList.remove('paragraph-hidden-end');
drop3.classList.remove('flip-vertical');
}
if(para1.dataset.open === 'true'){
para1.classList.add('paragraph-hidden');
para1.dataset.open = 'false';
para1.classList.remove('paragraph-hidden-end');
drop1.classList.remove('flip-vertical');
}
});