-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbefore.js
More file actions
39 lines (35 loc) · 1.01 KB
/
before.js
File metadata and controls
39 lines (35 loc) · 1.01 KB
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
/* Loading Animation */
square = 1
function switchSquare(square){
if(square == 5){square = 1}
square +=1
return square
}
function animSquare(square){
if(square == 5){square = 1}
// console.log("Square |", square)
oldSquare = square - 1
if (oldSquare == 0){oldSquare = 4}
// console.log("OLD Square |", oldSquare)
document.getElementById("sq" + oldSquare).setAttribute("class", "square")
getSquare = document.getElementById("sq" + square)
getSquare.setAttribute("class", "square animated")
}
setTimeout(function(){
square = switchSquare(square)
animSquare(square)
}, 10);
$tmpLoad = setInterval(function(){
square = switchSquare(square)
animSquare(square)
}, 1900);
/* On Ready */
window.onload = function(e){
console.log("App Loaded:\n", e)
setTimeout(function(){
clearInterval($tmpLoad);
document.getElementById("page-loader").remove();
document.body.removeAttribute("class");
document.getElementById("bef").remove();
}, 1200)
}