-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathshell.html
More file actions
393 lines (368 loc) · 14 KB
/
Copy pathshell.html
File metadata and controls
393 lines (368 loc) · 14 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
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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<!-- hack for ios 14.6 to get around indexeddb bug -->
<script type="text/javascript">window.indexedDB;</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0" />
<meta name="description" content="Web Based Game Boy Advance, Game Boy and Game Boy Color Emulator">
<meta name="keywords" content="GBA, Game Boy Advance, Emulator, Game Boy, GB, GBC, Game Boy Color">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=1">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=1">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=1">
<link rel="manifest" href="/site.webmanifest?v=1">
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=1" color="#759091">
<link rel="shortcut icon" href="/favicon.ico?v=1">
<meta name="apple-mobile-web-app-title" content="SkyEmu">
<meta name="application-name" content="SkyEmu">
<meta name="msapplication-TileColor" content="#759091">
<meta name="msapplication-config" content="/browserconfig.xml?v=1">
<meta name="theme-color" content="#759091">
<title>SkyEmu</title>
<style>
body{padding:0; margin:0;}
.emscripten { padding: 0; margin: 0; display: block; }
textarea.emscripten { font-family: monospace; width: 80%; }
div.emscripten { text-align: center; }
div.emscripten_border { border: 1px solid black; }
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten {
background-color: black;
width: 100%;
height: 100%;
}
#canvas {
position: absolute;
top: 0px;
left: 0px;
margin: 0px;
width: 100%;
height: 100%;
overflow: hidden;
display: block;
}
input[type="file"] {
display: block !important;
opacity: 0% !important;
overflow: hidden !important;
z-index: 100 !important;
margin-top: 0px;
padding-top: 0px;
position: absolute;
visibility:hidden;
}
.spinner {
height: 50px;
width: 50px;
margin: 0px auto;
-webkit-animation: rotation .8s linear infinite;
-moz-animation: rotation .8s linear infinite;
-o-animation: rotation .8s linear infinite;
animation: rotation 0.8s linear infinite;
border-left: 10px solid rgb(0,150,240);
border-right: 10px solid rgb(0,150,240);
border-bottom: 10px solid rgb(0,150,240);
border-top: 10px solid rgb(100,0,200);
border-radius: 100%;
background-color: rgb(200,100,250);
}
@-webkit-keyframes rotation {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
@-moz-keyframes rotation {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(360deg);}
}
@-o-keyframes rotation {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}
@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
/* PWA Install Popup Styles */
#pwaInstallPopup {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
z-index: 10000;
justify-content: center;
align-items: center;
}
#pwaInstallPopup.show {
display: flex;
}
.pwa-popup-content {
background-color: #2c2c2c;
color: #ffffff;
padding: 20px;
border-radius: 12px;
max-width: 90%;
width: 400px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
text-align: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.pwa-popup-content h2 {
margin: 0 0 15px 0;
font-size: 22px;
color: #759091;
}
.pwa-popup-content p {
margin: 10px 0;
font-size: 14px;
line-height: 1.5;
}
.pwa-popup-content ol {
text-align: left;
margin: 15px 0;
padding-left: 20px;
}
.pwa-popup-content li {
margin: 8px 0;
font-size: 14px;
line-height: 1.5;
}
.pwa-popup-button {
background-color: #759091;
color: #ffffff;
border: none;
padding: 12px 24px;
margin: 10px 5px 0 5px;
border-radius: 6px;
font-size: 16px;
cursor: pointer;
font-weight: bold;
}
.pwa-popup-button:hover {
background-color: #5a7071;
}
.pwa-popup-button.secondary {
background-color: #555555;
}
.pwa-popup-button.secondary:hover {
background-color: #666666;
}
</style>
</head>
<body>
<!-- PWA Install Popup -->
<div id="pwaInstallPopup">
<div class="pwa-popup-content">
<h2>Add SkyEmu to Home Screen</h2>
<p>Adding to the Home Screen tells the OS to avoid deleting your saves and allows us to enter full screen mode.</p>
<div id="pwaInstructions">
<!-- Instructions will be dynamically inserted here -->
</div>
<button class="pwa-popup-button" id="pwaGotItBtn">Got it!</button>
<button class="pwa-popup-button secondary" id="pwaDontShowBtn">Don't show again</button>
</div>
</div>
<figure style="overflow:visible;" id="spinner"><div class="spinner"></div><center style="margin-top:0.5em"><strong>emscripten</strong></center></figure>
<div class="emscripten" id="status">Downloading...</div>
<div class="emscripten">
<progress value="0" max="100" id="progress" hidden=1></progress>
</div>
<div class="emscripten_border" id="container">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
</div>
<!-- Code for displaying console
<hr/>
<textarea class="emscripten" id="output" rows="8"></textarea>
<hr>
-->
<script type='text/javascript'>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js').then(worker => {
}).catch(e => console.log('Failed to register service worker', e));
}
// PWA Install Popup Logic
var pwaEventListenersAttached = false;
function isMobileDevice() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
navigator.maxTouchPoints > 0;
}
function isStandalone() {
return window.matchMedia('(display-mode: standalone)').matches ||
window.navigator.standalone === true;
}
function getInstallInstructions() {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
// iOS Safari
if (/iPhone|iPad|iPod/i.test(userAgent) && !window.MSStream) {
return `
<p><strong>For iOS (Safari):</strong></p>
<ol>
<li>Tap the Share button <span style="font-size: 18px;">⎙</span></li>
<li>Scroll down and tap "Add to Home Screen"</li>
<li>Tap "Add" in the top right corner</li>
</ol>
`;
}
// Android Chrome
else if (/Android/i.test(userAgent)) {
return `
<p><strong>For Android (Chrome):</strong></p>
<ol>
<li>Tap the menu button (⋮) in the top right</li>
<li>Tap "Add to Home screen" or "Install app"</li>
<li>Tap "Add" or "Install" to confirm</li>
</ol>
`;
}
// Generic mobile
else {
return `
<p><strong>To install:</strong></p>
<ol>
<li>Look for the browser's menu (usually ⋮ or ⎙)</li>
<li>Select "Add to Home Screen" or "Install"</li>
<li>Follow the prompts to complete installation</li>
</ol>
`;
}
}
function closePWAPopup() {
document.getElementById('pwaInstallPopup').classList.remove('show');
}
function dontShowAgain() {
try {
localStorage.setItem('skyemu_hide_pwa_popup', 'true');
} catch (e) {
console.log('Could not save preference', e);
}
closePWAPopup();
}
function showPWAInstallPopup() {
// Only show on mobile devices
if (!isMobileDevice()) {
return;
}
// Don't show if already installed (running in standalone mode)
if (isStandalone()) {
return;
}
// Don't show if user dismissed it before
try {
if (localStorage.getItem('skyemu_hide_pwa_popup') === 'true') {
return;
}
} catch (e) {
console.log('Could not check localStorage', e);
}
// Ensure event listeners are attached (only once)
if (!pwaEventListenersAttached) {
var gotItBtn = document.getElementById('pwaGotItBtn');
var dontShowBtn = document.getElementById('pwaDontShowBtn');
if (gotItBtn) {
gotItBtn.addEventListener('click', closePWAPopup);
}
if (dontShowBtn) {
dontShowBtn.addEventListener('click', dontShowAgain);
}
pwaEventListenersAttached = true;
}
// Set the instructions based on device
document.getElementById('pwaInstructions').innerHTML = getInstallInstructions();
// Show the popup after a short delay
setTimeout(function() {
document.getElementById('pwaInstallPopup').classList.add('show');
}, 2000);
}
// Show popup when page fully loads
window.addEventListener('load', showPWAInstallPopup);
window.scroll(0,1);
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
var spinnerElement = document.getElementById('spinner');
var Module = {
preRun: [],
postRun: [],
print: (function() {
var element = document.getElementById('output');
if (element) element.value = ''; // clear browser cache
return function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&");
//text = text.replace(/</g, "<");
//text = text.replace(/>/g, ">");
//text = text.replace('\n', '<br>', 'g');
console.log(text);
if (element) {
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
}
};
})(),
printErr: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
var canvas = document.getElementById('canvas');
// As a default initial behavior, pop up an alert when webgl context is lost. To make your
// application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
// canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
// On WebGL context loss, silently reload the page.
canvas.addEventListener("webglcontextlost", function(e) {
e.preventDefault();
// small delay to let the event complete before reloading
setTimeout(function() { window.location.reload(); }, 50);
}, false);
return canvas;
})(),
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.last.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Module.setStatus.last.time < 30) return; // if this is a progress update, skip it if too soon
Module.setStatus.last.time = now;
Module.setStatus.last.text = text;
if (m) {
text = m[1];
progressElement.value = parseInt(m[2])*100;
progressElement.max = parseInt(m[4])*100;
progressElement.hidden = false;
spinnerElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
if (!text) spinnerElement.hidden = true;
}
statusElement.innerHTML = text;
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
};
var container = document.getElementById ("container");
Module.setStatus('Downloading...');
window.onerror = function() {
Module.setStatus('Exception thrown, see JavaScript console');
spinnerElement.style.display = 'none';
Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text);
};
};
</script>
{{{ SCRIPT }}}
</body>
</html>
</body>
</html>