-
Notifications
You must be signed in to change notification settings - Fork 23
/
loading-status.html
73 lines (62 loc) · 1.6 KB
/
loading-status.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
background-color: #333333;
color: #aaa;
font-family: 'sans-serif';
font-weight: 300;
user-select: none;
-webkit-user-select: none;
cursor: default;
display: flex;
justify-content: center;
flex-direction: column;
height: 100%;
padding: 0 40px;
}
.title {
font-size: 32px;
line-height: 1;
margin: 0;
font-weight: 900;
flex: 1;
margin-top: -3px; /* optical */
padding-bottom: 2px; /* optical */
}
.messages {
flex: 1;
min-height: 32px;
}
</style>
</head>
<body>
<div>
<div class="title">Loading <span class="filename"></span></div>
<div class="messages">Initializing …</div>
</div>
</body>
<script>
const { ipcRenderer } = require('electron')
const util = require('./js/utils')
const titleEl = document.querySelector('.title')
const messagesEl = document.querySelector('.messages')
const params = (new URL(document.location)).searchParams
let title = 'Loading ' + util.truncateMiddle(params.get('name')).replace('.sqlite', '')
titleEl.textContent = title
document.title = title
ipcRenderer.on('log', (event, opt) => {
console.log(`log: ${JSON.stringify(opt)}`)
if (opt.type === 'progress') {
messagesEl.textContent = opt.message + ' …'
}
})
</script>
</html>