-
Notifications
You must be signed in to change notification settings - Fork 2
/
updaterScreen.html
310 lines (299 loc) · 8.53 KB
/
updaterScreen.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<!-- <meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'sha256-nIcnn83YNljR5yr5x/oVAdAFNemfHxxTO3zjtez52do='"
/> -->
<title>Robotics Academy</title>
<style>
body {
position: absolute;
top: 0;
left: 0;
width: 500px;
height: 250px;
overflow: hidden !important;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none !important;
}
html {
color: #333333;
}
h1 {
margin-left: 0px;
}
.orginzationText {
font-weight: 800;
outline: none;
background: linear-gradient(
135deg,
#5335cf 0%,
#de005e 25%,
#f66e48 50%,
#de005e 75%,
#5335cf 100%
);
background-size: 400%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: textAnimate 20s linear infinite;
}
@keyframes textAnimate {
to {
background-position: 400%;
}
}
.draggable {
-webkit-user-select: none;
user-select: none;
-webkit-app-region: drag;
}
/* start */
.updater-container {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: start;
align-items: center;
background-color: white;
}
/* header */
.header {
width: 500px;
height: 2rem;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 0px;
background-color: #d9d9d9;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.2);
}
.header-logo-title {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.header > .header-logo-title > .header-logo {
margin-left: 12px;
height: 1.5rem;
width: 1.5rem;
}
.header > .header-logo-title > .header-title {
font-size: 14px;
font-weight: 500;
opacity: 80%;
}
.header > .header-close {
padding: 2px 8px 3px 8px;
fill: #333;
cursor: pointer;
transition-duration: 300ms;
transition-property: fill;
}
.header > .header-close:hover {
background: red;
fill: white;
}
/* updater-body */
.updater-body {
margin-top: 20px;
display: flex;
gap: 12px;
font-size: 16px;
color: rgba(51, 51, 51, 100);
font-weight: 400;
align-items: self-start;
width: 100%;
justify-content: center;
}
.updater-body > .updater-body-download-icon {
}
.updater-body > .updater-body-update-info {
display: flex;
flex-direction: column;
gap: 8px;
}
.updater-body > .updater-body-update-info > p {
margin: 0px !important;
}
/* buttons */
.buttons {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
margin-top: 40px;
}
.button {
width: 90px;
height: 30px;
color: #f3f3f3;
border-radius: 5px;
display: flex;
justify-content: center;
font-weight: 500;
align-items: center;
box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
cursor: pointer;
}
.buttons > .buttons-yes {
background-color: #f5c000;
}
.buttons > .buttons-no {
background-color: #bf1e12;
}
/* footer */
.footer {
width: 100%;
position: absolute;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: end;
margin-bottom: 8px;
}
.footer > .footer-change-log {
text-decoration: underline;
color: rgba(0, 51, 255, 0.89);
font-size: 12px;
margin-left: 84px;
cursor: pointer;
}
.footer > .powered {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-right: 12px;
}
.footer > .powered > .powered-by {
font-size: 12px;
font-weight: 400;
color: #a4a4a4;
padding-bottom: 2px;
margin-left: 4px;
}
</style>
<script>
window.onload = async function () {
// get current version
try {
const c_version = await window.api.getAppVersion()
const version = document.getElementById('current-version')
if (c_version.status === 'SUCCESS') {
version.textContent = c_version.data
}
} catch (err) {
console.log(err)
}
}
</script>
</head>
<body>
<div class="updater-container">
<!-- header -->
<div class="header">
<div class="header-logo-title draggable">
<img src="./resources/icons/icon.png" alt="jdeRobot" class="header-logo" />
<span class="header-title">Robotics Academy Desktop Update Available</span>
</div>
<div class="header-close" id="close-window">
<svg
xmlns="http://www.w3.org/2000/svg"
height="24px"
viewBox="0 -960 960 960"
width="25px"
>
<path
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"
/>
</svg>
</div>
</div>
<!-- updater-body -->
<div class="updater-body">
<!-- download-icon -->
<div class="updater-body-download-icon">
<svg
xmlns="http://www.w3.org/2000/svg"
height="48px"
viewBox="0 -960 960 960"
width="48px"
fill="#0C94FB"
>
<path
d="M260-120v-73l47-47H140q-24 0-42-18t-18-42v-480q0-24 18-42t42-18h397v60H140v480h680v-139h60v139q0 24-18 42t-42 18H652l48 47v73H260Zm367-226L434-539l42-42 121 120v-379h60v379l121-120 42 42-193 193Z"
/>
</svg>
</div>
<!-- update informations -->
<div class="updater-body-update-info">
<p>A new version of Robotics Academy Desktop Available.</p>
<p>Do you want to download version <span id="update-version">2.0.1</span> ?</p>
<p>Version on your system <span id="current-version">2.0.0</span></p>
</div>
</div>
<!-- button -->
<div class="buttons">
<!-- yes -->
<div class="button buttons-yes" id="button-yes">Yes</div>
<!-- no -->
<div class="button buttons-no" id="button-no">No</div>
</div>
<!-- footer -->
<div class="footer">
<!-- -->
<div></div>
<!-- change log link -->
<div class="footer-change-log" id="change-log">change log</div>
<!-- powered by -->
<div class="powered">
<span class="powered-by">Powered by</span>
<span class="orginzationText">JdeRobot</span>
</div>
</div>
</div>
<script>
//func
async function closeWindowFunc() {
try {
window.api.updaterWindowClose()
} catch (err) {
console.log(err)
}
}
// element to close window
const closeButton = document.getElementById('close-window')
const noButton = document.getElementById('button-no')
closeButton.addEventListener('click', closeWindowFunc)
noButton.addEventListener('click', closeWindowFunc)
// element to open link
const openLink = async () => {
try {
let url = `https://github.com/JdeRobot/RoboticsAcademy-Desktop/releases/`
const version = document.getElementById('update-version')
if (version && version.textContent.length > 0) {
url += `tag/${version.textContent}`
}
window.api.updaterWindowOpenLink(url)
} catch (err) {
console.log(err)
}
}
// elements link
const yesButton = document.getElementById('button-yes')
const changeLog = document.getElementById('change-log')
yesButton.addEventListener('click', openLink)
changeLog.addEventListener('click', openLink)
</script>
</body>
</html>