-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
204 lines (174 loc) · 5.62 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Windows-update</title>
<style>
* {
padding: 0;
margin: 0;
}
.update {
background-color: black;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.update__content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.update__spinner {
text-align: center;
margin: 20px;
}
.update__text {
text-align: center;
color: #fbfdfd;
font-family: sans-serif;
font-size: 20px;
line-height: 30px;
}
.update__loader {
height: 50px;
width: 50px;
margin: 20px;
}
.update__spinner {
width: 50px;
height: 50px;
border-radius: 50px;
position: absolute;
margin: 0;
animation-name: rotate;
animation-duration: 1.4s;
animation-timing-function: cubic-bezier(0.05, 0.57, 0.63, 0.38);
animation-delay: 0s;
animation-iteration-count: infinite;
}
.update__spinner--second {
animation-delay: 0.2s;
}
.update__spinner--third {
animation-delay: 0.4s;
}
.update__spinner--four {
animation-delay: 0.6s;
}
.update__spinner--five {
animation-delay: 0.8s;
}
.update__spinner--six {
animation-delay: 1s;
}
.spinner__point {
width: 7px;
height: 7px;
border-radius: 10px;
background-color: white
}
@keyframes rotate {
0% {
transform: rotate(0.7turn)
}
100% {
transform: rotate(1.7turn)
}
}
</style>
</head>
<body>
<div class="update">
<div class="update__content">
<div class="update__loader">
<div class="update__spinner">
<div class="spinner__point"></div>
</div>
<div class="update__spinner update__spinner--second">
<div class="spinner__point"></div>
</div>
<div class="update__spinner update__spinner--third">
<div class="spinner__point"></div>
</div>
<div class="update__spinner update__spinner--four">
<div class="spinner__point"></div>
</div>
<div class="update__spinner update__spinner--five">
<div class="spinner__point"></div>
</div>
</div>
<div class="update__text">
<p>Working on updates</p>
<p id="update__percentage">0% complete</p>
<p>Don't turn off your computer</p>
</div>
</div>
</div>
<script>
// Init percentage
let percentage = 0;
let currentTime;
let time = 500000; // 5 minutes
let refresh = 1000; // 1 second
window.onload = function () {
currentTime = time;
requestFullscreen();
loading();
}
function loading() {
currentTime -= refresh;
percentage = ((time - currentTime) * 100) / time;
document.querySelector('#update__percentage').innerHTML = parseInt(percentage) + '% complete';
if (currentTime != 0) {
setTimeout(loading, refresh);
}
}
// Automatically request fullscreen
function requestFullscreen() {
const element = document.documentElement;
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) { // Firefox
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) { // Chrome, Safari, and Opera
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) { // IE/Edge
element.msRequestFullscreen();
}
}
// Block key combinations like Esc, F11 (fullscreen toggle), etc.
document.addEventListener('keydown', function (event) {
// Block F11 (Fullscreen Toggle) and Escape
if (event.key === 'F11' || event.key === 'Escape') {
event.preventDefault();
}
// Attempt to block Alt+F4 (Note: this is OS-level and not entirely blockable)
if ((event.altKey && event.key === 'F4') || (event.ctrlKey && event.key === 'w')) {
event.preventDefault();
}
});
// Attempt to re-enable fullscreen if the user tries to exit it
document.addEventListener('fullscreenchange', function () {
if (!document.fullscreenElement) {
requestFullscreen(); // Re-enter fullscreen if exited
}
});
// Disable right-click context menu
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
});
// Disable text selection
document.onselectstart = function () {
return false;
};
// Disable dragging
document.ondragstart = function () {
return false;
};
</script>
</body>
</html>