forked from a456pur/seraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
offline.html
394 lines (325 loc) · 13.1 KB
/
offline.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/images/ico.ico" type="image/x-icon">
<title>Offline | Seraph</title>
<style>
@font-face {
font-family: 'Ubuntu';
src: url('/storage/fonts/ubuntu/Ubuntu.woff2') format('woff2'),
}
body {
margin: 0;
padding: 0;
font-family: 'Ubuntu', sans-serif;
display: flex;
background-color: black;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
animation: mainHeaderAnimation 2s forwards;
background-image: url('/images/backgrounds/seraph/offlinebg.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
}
.content-side {
width: 100%;
color: white;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
animation: mainHeaderAnimation 1s ease-in-out forwards;
}
h1 {
font-size: 96px;
font-weight: 500;
font-family: 'Ubuntu', sans-serif;
text-shadow: 0 0 10px white,
0 0 10px black,
0 0 30px white,
0 0 40px black,
0 0 50px white,
0 0 60px black,
0 0 70px white,
0 0 80px #000000;
margin-bottom: 0px;
font-weight: bold;
}
h2 {
font-size: 20px;
font-weight: 500;
}
p {
font-size: 18px;
margin-bottom: 2px;
padding-left: 10%;
padding-right: 10%;
text-align: center;
text-shadow: 5px 5px 5px var(--text-glow);
}
.linkp a {
font-size: 20px;
text-align: center;
border: 3px solid transparent;
transition: 0.15s ease-in-out;
text-shadow: 5px 5px 5px var(--text-glow);
}
.linkp a:hover {
color: rgb(199, 192, 192);
}
a {
font-size: 18px;
text-decoration: underline;
color: var(--text-color);
text-shadow: 5px 5px 5px var(--text-glow);
}
.button-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.button {
background-color: black;
border: 3px solid white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 8px;
width: calc(50% - 10px);
max-width: 480px;
width: 400px;
max-height: 100px;
box-sizing: border-box;
padding-left: 10px;
padding-right: 10px;
background-repeat: no-repeat;
background-size: cover;
border: 3.2px solid white;
border-radius: 16px;
transition: border 0.1s ease-in-out;
position: relative;
}
.button:hover {
background-color: black;
border: 3.2px solid rgb(200, 189, 189);
}
.button h2 {
font-size: 30px;
text-align: center;
}
.delete-button {
position: absolute;
top: 5px;
right: 5px;
z-index: 2;
}
#online-notice {
display: none;
background-color: #050505;
border: 3px solid white;
border-radius: 16px;
color: white;
text-align: center;
padding: 15px;
font-family: 'Ubuntu', sans-serif;
z-index: 1000;
font-size: 16px;
width: 100%;
max-width: 500px;
}
@keyframes mainHeaderAnimation {
0% {
opacity: 0;
transform: translateY(-5%);
}
100% {
opacity: 1;
transform: translateY(0%);
}
}
</style>
</head>
<body>
<div class="content-side">
<h1 class="typewriter"><span id="cursor">seraph</span></h1>
<h2>version 10 / release build (offline mode)</h2>
<div id="online-notice" >you appear to have an internet connection now! go back to the main version of seraph by refreshing the page.</div>
<br>
<br>
<h2 style="font-size: 30px;">downloaded games</h2>
<div class="button-container">
</div>
<br>
<a style="text-decoration: none;">˗ˏˋ❀ website created & developed by @a456pur ❀ ´ˎ˗</a>
<br>
<br>
<br>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const games = JSON.parse(localStorage.getItem('downloadedGames')) || [];
const container = document.querySelector('.button-container');
games.forEach(game => {
const gameButton = document.createElement('a');
gameButton.setAttribute('href', '/games/' + game.directory);
gameButton.innerHTML = `
<div class="button" style="background-image: url('${game.thumbnail}');" data-genre="platformer">
<h2>${game.name}</h2>
<span class="delete-button" data-game="${game.directory}">✖</button>
</div>
`;
container.appendChild(gameButton);
});
document.querySelectorAll('.delete-button').forEach(button => {
button.addEventListener('click', (event) => {
event.preventDefault();
const gameDirectory = event.target.getAttribute('data-game');
deleteGame(gameDirectory);
});
});
});
async function deleteGame(gameDirectory) {
const games = JSON.parse(localStorage.getItem('downloadedGames')) || [];
const updatedGames = games.filter(game => game.directory !== gameDirectory);
localStorage.setItem('downloadedGames', JSON.stringify(updatedGames));
const cache = await caches.open('game-cache');
const response = await fetch('/storage/js/directories.json');
if (!response.ok) {
throw new Error('Failed to fetch directory list');
}
const directoryList = await response.json();
const gameData = directoryList[gameDirectory];
if (gameData && gameData.files) {
for (const file of gameData.files) {
await cache.delete(file);
}
await cache.delete(gameData.thumbnail);
}
window.location.reload();
}
</script>
<script>
// cloaking
function setCookie(name, value, options) {
options = options || {};
let expires = options.expires;
if (typeof expires == "number" && expires) {
const d = new Date();
d.setTime(d.getTime() + expires * 24 * 60 * 60 * 1000);
expires = options.expires = d;
}
if (expires && expires.toUTCString) {
options.expires = expires.toUTCString();
}
value = encodeURIComponent(value);
let updatedCookie = name + "=" + value;
for (const propName in options) {
updatedCookie += "; " + propName;
const propValue = options[propName];
if (propValue !== true) {
updatedCookie += "=" + propValue;
}
}
document.cookie = updatedCookie;
}
function getCookie(name) {
const matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
document.addEventListener("DOMContentLoaded", function() {
const selectedPreset = getCookie("tabCloakPreset");
const presets = {
google: {
favicon: "/images/icons/google.ico",
title: "Google"
},
bing: {
favicon: "/images/icons/bing.ico",
title: "Bing"
},
gmail: {
favicon: "/images/icons/gmail.ico",
title: "Gmail"
},
desmos: {
favicon: "/images/icons/desmos.ico",
title: "Desmos | Graphing Calculator"
},
googleclassroom: {
favicon: "/images/icons/googleclassroom.ico",
title: "Home"
},
wikipedia: {
favicon: "/images/icons/wikipedia.ico",
title: "Wikipedia"
},
chrometab: {
favicon: "/images/icons/chromenewtab.ico",
title: "New Tab"
},
googledrive: {
favicon: "/images/icons/googledrive.ico",
title: "My Drive"
}
};
if (selectedPreset && presets[selectedPreset]) {
const preset = presets[selectedPreset];
document.title = preset.title;
const newFavicon = document.createElement("link");
newFavicon.rel = "icon";
newFavicon.href = preset.favicon;
const existingFavicon = document.querySelector("link[rel='icon']");
if (existingFavicon) {
document.head.removeChild(existingFavicon);
}
document.head.appendChild(newFavicon);
}
});
(function() {
const panicKey = localStorage.getItem('panicKey');
const panicUrl = localStorage.getItem('panicUrl') || 'https://www.desmos.com/scientific';
if (!panicKey) {
return;
}
const keys = new Set(panicKey.split('+'));
const pressedKeys = new Set();
function keyHandler(event) {
pressedKeys.add(event.key);
for (let key of keys) {
if (!pressedKeys.has(key)) {
return;
}
}
document.body.innerHTML = '';
window.location.href = panicUrl;
}
function keyUpHandler(event) {
pressedKeys.delete(event.key);
}
document.addEventListener('keydown', keyHandler);
document.addEventListener('keyup', keyUpHandler);
})();
</script>
<script>
function checkInternetConnection() {
const onlineNotice = document.getElementById('online-notice');
if (navigator.onLine) {
onlineNotice.style.display = 'block';
} else {
onlineNotice.style.display = 'none';
}
}
window.onload = checkInternetConnection;
window.addEventListener('online', checkInternetConnection);
window.addEventListener('offline', checkInternetConnection);
</script>
</body>
</html>