-
Notifications
You must be signed in to change notification settings - Fork 1
/
event.js
53 lines (43 loc) · 1.4 KB
/
event.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
let arrow2=document.getElementById("arrow");
let arrow=document.getElementById("rulesHeaderTitle")
let rulesContent=document.getElementById("rulesContent");
let active=false;
arrow2.addEventListener("click", function(){
if (active==false){
rulesAppear();
active=true;}
else{
rulesDisappear();
active=false;}
});
arrow.addEventListener("click", function(){
if (active==false){
rulesAppear();
active=true;}
else{
rulesDisappear();
active=false;}
});
function rulesAppear(e){
arrow2.style.transform='rotate(180deg)';
arrow2.style.translate='12px';
// rulesContent.style.height='fit-content';
rulesContent.style.transform = 'scaleY(1)';
rulesContent.style.transformOrigin = "top";
document.getElementById('coordinatorsss').scrollIntoView();
rulesContent.style.opacity = '1';
arrow2.style.transitionDuration = '.5s';
rulesContent.style.transitionDuration = '.5s';
}
function rulesDisappear(e){
arrow2.style.transform='rotate(-0deg)';
arrow2.style.translate='0px';
rulesContent.style.opacity = '0';
// rulesContent.style.height='0px';
rulesContent.style.transform = 'scaleY(0)';
}
let scrolldown = document.getElementById('scrolldown');
scrolldown.addEventListener('click',scrolldownfunction);
function scrolldownfunction(){
document.getElementById('coordinatorsss').scrollIntoView();
}