forked from flyerq/minesweeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdater.html
More file actions
82 lines (76 loc) · 2.27 KB
/
updater.html
File metadata and controls
82 lines (76 loc) · 2.27 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
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<title>扫雷 - 版本更新</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
html,body {
margin: 0;
padding: 0;
overflow: hidden;
user-select: none;
background: rgba(0, 0, 0, 0);
}
.wrapper {
display: flex;
height: 100vh;
flex-direction: column;
text-align: center;
justify-content: center;
align-items: center;
font: normal 14px/1 "PingFang SC","Microsoft YaHei UI","微软雅黑",Arial,"Hiragino Sans GB",sans-serif;
}
.progress {
position: relative;
box-sizing: border-box;
width: 96%;
padding: 4px;
background: rgba(0, 0, 0, 0.25);
border-radius: 6px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px rgba(255, 255, 255, 0.08);
overflow: hidden;
}
.progress-bar {
position: relative;
height: 28px;
width: 0;
visibility: hidden;
max-width: 100%;
border-radius: 4px;
background-color: #0e89b6;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
transition: width 0.4s ease;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.1);
overflow: hidden;
}
.tips {
position: absolute;
font-size: 16px;
color: rgba(255, 255, 255, 0.9);
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6);
margin: 0;
padding: 0;
z-index: 10;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="progress">
<div id="percentBar" class="progress-bar"></div>
</div>
<p class="tips">正在下载更新(<span id="percentText">0%</span>)</p>
</div>
<script>
const { ipcRenderer } = require('electron');
ipcRenderer.on('progress', function(event, p) {
let percentBar = document.getElementById('percentBar');
let percentText = document.getElementById('percentText');
percentBar.style.visibility = 'visible';
percentBar.style.width = p + '%';
percentText.innerText = p + '%';
});
</script>
</body>
</html>