-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
106 lines (90 loc) · 1.94 KB
/
index.html
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
<style>
html,
body {
padding: 0;
margin: 0;
position: relative;
height: 100vh;
font-family: "Raleway", sans-serif;
overflow-y: hidden;
}
.page-loader {
width: 100%;
height: 100vh;
position: absolute;
background: #272727;
z-index: 1000;
}
.page-loader .txt {
color: #666;
text-align: center;
top: 40%;
position: relative;
text-transform: uppercase;
letter-spacing: 0.3rem;
font-weight: bold;
line-height: 1.5;
}
.spinner {
position: relative;
top: 35%;
width: 80px;
height: 80px;
margin: 0 auto;
background-color: #fff;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}
@-webkit-keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
}
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}
@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}
</style>
<html>
<div class="page-loader">
<div class="spinner"></div>
<div class="txt">Loading...</div>
</div>
</div>
</html>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event) {
setInterval(() => {
check('/ping')
}, 2000);
});
function check(url) {
try {
var xmlhttp;
// compatible with IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState !== 4) return
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var json = JSON.parse(xmlhttp.response)
if (json.success) location.href = json.url;
}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
} catch (e) {
}
}
</script>