-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (31 loc) · 1009 Bytes
/
index.js
File metadata and controls
40 lines (31 loc) · 1009 Bytes
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
/* You may keep or alter this code in any manner you see fit
* please consider extending/improving the pattern started here
* for all deliverables (though not required)
*/
/***************************** INSTANT ANIMATIONS *****************************/
function hide(el) {
el.style.opacity = 0
el.classList.remove("fade-up-out")
el.style.pointerEvents = "none"
}
function appear(el) {
el.style.opacity = 1
el.style.pointerEvents = "auto"
}
/******************************************************************************/
/***************************** DURATION ANIMATIONS ****************************/
function fadeAllOut(elArray) {
elArray.forEach(el => {
el.classList.add("fade-up-out")
})
setTimeout(() => {
elArray.forEach(hide)
}, FADEDURATION)
}
/******************************************************************************/
function transitionPage(groupOut, groupIn) {
fadeAllOut(groupOut)
setTimeout(() => {
groupIn.forEach(appear)
}, FADEDURATION)
}