Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (103 loc) · 3.02 KB
/
Copy pathindex.html
File metadata and controls
116 lines (103 loc) · 3.02 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading...</title>
<style>
body {
background-color: #282c34;
margin: 0;
padding: 0;
}
.lds-facebook {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-facebook div {
display: inline-block;
position: absolute;
left: 8px;
width: 16px;
background: #fff;
animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}
.lds-facebook div:nth-child(1) {
left: 8px;
animation-delay: -0.24s;
}
.lds-facebook div:nth-child(2) {
left: 32px;
animation-delay: -0.12s;
}
.lds-facebook div:nth-child(3) {
left: 56px;
animation-delay: 0;
}
@keyframes lds-facebook {
0% {
top: 8px;
height: 64px;
}
50%, 100% {
top: 24px;
height: 32px;
}
}
.content {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.content * {
color: white;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.content pre {
font-family: monospace;
}
</style>
</head>
<body>
<div class="content">
<div class="lds-facebook"><div></div><div></div><div></div></div>
<h1>Loading...</h1>
<pre id="log">Initializing...</pre>
<script>
let log = document.getElementById('log');
log.innerText = "Waiting for Electron connection...";
const loaded = () => {
log.innerText = "Waiting for React connection...";
wait();
}
const wait = () => {
if(UrlExists(REACT_URL)) {
log.innerText = "Connected to React!\nLoading webpage...";
setTimeout(connect, 500);
}
else
setTimeout(wait, 1000);
}
const connect = () => {
window.location = REACT_URL;
}
function UrlExists(url) {
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
try {
http.send();
} catch (error) {
return false;
}
return true;
}
</script>
</div>
</body>
</html>