-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
122 lines (106 loc) · 2.97 KB
/
demo.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="theme-color" content="#ffffff">
<meta name="msapplication-navbutton-color" content="#ffffff">
<meta name="apple-mobile-web-app-status-bar-style" content="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<meta charset="UTF-8">
<title>Github Updater</title>
<style>
* {
box-sizing: border-box;
}
html {
font-size: 20px;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
padding: 16px;
font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
}
p {
margin: 0;
}
p:not(:last-child) {
margin-bottom: 1em;
}
.popup {
width: 500px;
padding: 2rem 3rem;
text-align: center;
border-radius: 1rem;
box-shadow: 0 0 2rem rgba(0, 0, 0, 0.3);
color: #242424;
}
.js-info {
color: #1799fb;
font-size: 1.5rem;
}
.loader {
display: block;
text-align: center;
height: 2rem;
}
.loader:after {
content: '';
display: inline-block;
width: 2rem;
height: 2rem;
border: 0.2rem solid transparent;
border-bottom-color: #1799fb;
border-left-color: #1799fb;
border-radius: 2rem;
animation: spin 0.5s infinite linear;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="popup">
<p class="title">Repository import in progress</p>
<p class="js-info"></p>
</div>
<script>
(() => {
const info = document.querySelector(".js-info");
info.classList.add("loader");
// Увага!
// Цей файл для демонстрації вигляду скрипта оновлення
// Робочий скрипт - https://github.com/da411d/github-updater/blob/master/import_github.php
const securityKey = "SOME-RANDOM-STRING-HERE-1234567890";
const passedSecurityKey = location.hash.substr(1);
history.replaceState({}, null, "#");
if(securityKey === passedSecurityKey){
setTimeout(() => {
info.innerText = "Success";
info.classList.remove("loader");
setTimeout(() => location.assign("https://github.com/da411d/github-updater"), 3000);
}, 5000)
}else{
info.innerText = "Invalid security key";
info.classList.remove("loader");
}
})();
</script>
</body>
<!--
Code written by David Manzhula @da411d
https://da411d.me/
-->
</html>