-
Notifications
You must be signed in to change notification settings - Fork 0
/
animation.js
76 lines (58 loc) · 2.04 KB
/
animation.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
function copyText() {
var l = document.getElementById("link");
l.select();
l.setSelectionRange(0, 99999);
document.execCommand("copy");
alert("Copied the text: " + l.value);
}
function menuAppear() {
var area = document.getElementById("area-for-menu");
var container = document.getElementById("menu-background");
area.style = "width:100%";
area.style.display = "block";
container.style.opacity = "1";
}
function menuRetract() {
var area = document.getElementById("area-for-menu");
var container = document.getElementById("menu-background");
area.style = "width:0%; transition-delay:0.4s;";
container.style.opacity = "0";
}
function boxAppear(n) {
//for the menu to retract before the appearence of the new background
var area = document.getElementById("area-for-menu");
var container = document.getElementById("menu-background");
var areaInfo = document.getElementById("area-for-info");
var infoContainer = document.getElementById("info-background");
area.style = "width:0%; transition-delay:0.2s;";
areaInfo.style = "width:100%;";
container.style = "opacity:0;transition-duration:0.2s";
infoContainer.style = "opacity:1;";
var info;
switch (n) {
case 1:
info = document.getElementById("info1");
info.style = "display:block;";
break;
case 2:
info = document.getElementById("info2");
info.style = "display:block;";
break;
case 3:
info = document.getElementById("info3");
info.style = "display:block;";
break;
}
}
function infoRetract() {
var area = document.getElementById("area-for-info");
var container = document.getElementById("info-background");
area.style = "width:0%; transition-delay:0.4s;";
container.style.opacity = "0";
var info = document.getElementById("info1");
var info1 = document.getElementById("info2");
var info2 = document.getElementById("info3");
info.style = "display:none;";
info1.style = "display:none;";
info2.style = "display:none;";
}