-
Notifications
You must be signed in to change notification settings - Fork 0
/
loading.html
67 lines (67 loc) · 1.73 KB
/
loading.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="referrer" content="no-referrer">
<title>Jasper</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
/* Prevent bright flash while loading */
background-color: black;
background-image: url("jasper-dark.png");
background-blend-mode: soft-light;
background-position: center center;
background-repeat: no-repeat;
animation: fadein 5s ease-in-out;
animation-iteration-count: infinite;
height: 100vh;
overflow: hidden;
}
#log-container {
position: absolute;
top: calc(50% + 100px);
left: 8px;
right: 8px;
bottom: 0;
overflow: hidden;
-webkit-mask-image: linear-gradient(to bottom, transparent, #FFF 10%, #FFF 100%);
}
#logs {
font-family: monospace;
position: absolute;
bottom: 0;
color: #AAA;
white-space: nowrap;
}
@keyframes fadein {
from {
background-color: black;
}
50% {
background-color: #212121;
}
to {
background-color: black;
}
}
</style>
<script>
window.electronAPI.streamLogs((event, data) => {
const withoutColors = data.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
const lines = withoutColors.split(/[\r\n]+/);
for (let line of lines) {
line = line.trim();
if (!line) continue;
document.getElementById('logs').append(line);
document.getElementById('logs').appendChild(document.createElement('br'));
}
});
</script>
</head>
<body>
<div id="log-container">
<div id="logs"></div>
</div>
</body>
</html>