-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimations.js
135 lines (132 loc) · 5.69 KB
/
animations.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
var shadeWidth = 0;
var i = 0;
function launchTransition() {
i = 0;
setTimeout(function () {
document.getElementById('s1').style.setProperty("right", null);
document.getElementById('s2').style.setProperty("right", null);
document.getElementById('s3').style.setProperty("right", null);
document.getElementById('s4').style.setProperty("right", null);
document.getElementById('s5').style.setProperty("right", null);
document.getElementById('s1').style.setProperty("left", "0");
document.getElementById('s2').style.setProperty("left", "20vw");
document.getElementById('s3').style.setProperty("left", "40vw");
document.getElementById('s4').style.setProperty("left", "60vw");
document.getElementById('s5').style.setProperty("left", "80vw");
}, 500);
console.log('anchor updated: left')
for (i = 0; i < 20; i++) {
console.log('shadeAddition:' + shadeWidth);
shadeWidth = shadeWidth + 1;
document.getElementById("s1").style.width = shadeWidth + "vw";
document.getElementById("s2").style.width = shadeWidth + "vw";
document.getElementById("s3").style.width = shadeWidth + "vw";
document.getElementById("s4").style.width = shadeWidth + "vw";
document.getElementById("s5").style.width = shadeWidth + "vw";
}
}
function closeTransition() {
i = 0;
setTimeout(function () {
document.getElementById('s1').style.setProperty("left", null);
document.getElementById('s2').style.setProperty("left", null);
document.getElementById('s3').style.setProperty("left", null);
document.getElementById('s4').style.setProperty("left", null);
document.getElementById('s5').style.setProperty("left", null);
document.getElementById('s1').style.setProperty("right", "80vw");
document.getElementById('s2').style.setProperty("right", "60vw");
document.getElementById('s3').style.setProperty("right", "40vw");
document.getElementById('s4').style.setProperty("right", "20vw");
document.getElementById('s5').style.setProperty("right", "0");
}, 500);
console.log('anchor updated: right');
for (i = 0; i < 20; i++) {
console.log('shadeReduction:' + shadeWidth);
shadeWidth = shadeWidth - 1;
document.getElementById("s1").style.width = shadeWidth + "vw";
document.getElementById("s2").style.width = shadeWidth + "vw";
document.getElementById("s3").style.width = shadeWidth + "vw";
document.getElementById("s4").style.width = shadeWidth + "vw";
document.getElementById("s5").style.width = shadeWidth + "vw";
}
}
// SLIDER transition
function launchTransition2() {
i = 0;
setTimeout(function () {
document.getElementById('s2').style.setProperty("right", null);
document.getElementById('s3').style.setProperty("right", null);
document.getElementById('s4').style.setProperty("right", null);
document.getElementById('s5').style.setProperty("right", null);
document.getElementById('s2').style.setProperty("left", "20vw");
document.getElementById('s3').style.setProperty("left", "40vw");
document.getElementById('s4').style.setProperty("left", "60vw");
document.getElementById('s5').style.setProperty("left", "80vw");
}, 500);
console.log('anchor updated: left')
for (i = 0; i < 20; i++) {
console.log('shadeAddition:' + shadeWidth);
shadeWidth = shadeWidth + 1;
document.getElementById("s2").style.width = shadeWidth + "vw";
document.getElementById("s3").style.width = shadeWidth + "vw";
document.getElementById("s4").style.width = shadeWidth + "vw";
document.getElementById("s5").style.width = shadeWidth + "vw";
}
}
function closeTransition2() {
i = 0;
setTimeout(function () {
document.getElementById('s2').style.setProperty("left", null);
document.getElementById('s3').style.setProperty("left", null);
document.getElementById('s4').style.setProperty("left", null);
document.getElementById('s5').style.setProperty("left", null);
document.getElementById('s2').style.setProperty("right", "60vw");
document.getElementById('s3').style.setProperty("right", "40vw");
document.getElementById('s4').style.setProperty("right", "20vw");
document.getElementById('s5').style.setProperty("right", "0");
}, 500);
console.log('anchor updated: right');
for (i = 0; i < 20; i++) {
console.log('shadeReduction:' + shadeWidth);
shadeWidth = shadeWidth - 1;
document.getElementById("s2").style.width = shadeWidth + "vw";
document.getElementById("s3").style.width = shadeWidth + "vw";
document.getElementById("s4").style.width = shadeWidth + "vw";
document.getElementById("s5").style.width = shadeWidth + "vw";
}
}
//MENU transition
function launchTransition3() {
i = 0;
setTimeout(function () {
document.getElementById('s1').style.setProperty("right", null);
document.getElementById('s1').style.setProperty("left", "0");
}, 500);
console.log('anchor updated: left')
for (i = 0; i < 20; i++) {
console.log('shadeAddition:' + shadeWidth);
shadeWidth = shadeWidth + 1;
document.getElementById("s1").style.width = shadeWidth + "vw";
}
}
function closeTransition3() {
i = 0;
setTimeout(function () {
document.getElementById('s1').style.setProperty("left", null);
document.getElementById('s1').style.setProperty("right", "80vw");
}, 500);
console.log('anchor updated: right');
for (i = 0; i < 20; i++) {
console.log('shadeReduction:' + shadeWidth);
shadeWidth = shadeWidth - 1;
document.getElementById("s1").style.width = shadeWidth + "vw";
}
}
console.log('transitions imported');
/*
var outlinkHandler = document.getElementById('outlink');
outlinkHandler.onclick = outlink(link);
function outlink(link) {
window.location.href = "" + link + "";
}
*/