forked from TheGLander/tworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.html
118 lines (113 loc) · 4.82 KB
/
shell.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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tile World</title>
<link rel="canonical" href="https://enderandrew.com/chip/" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
<link rel="manifest" href="./site.webmanifest">
<link rel="mask-icon" href="./safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="Tile World">
<meta name="application-name" content="Tile World">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta property="og:type" content="website" />
<meta property="og:title" content="Tile World" />
<meta property="og:description" content="Play Tile World, a remake of Chip's Challenge directly in the browser" />
<meta property="og:image" content="https://enderandrew.com/sm/logo.png" />
<!-- Google tag (gtag.js) -->
<meta name="google-site-verification" content="Fw32VtOfNNMYuxwq-LDxGbzuY7QIxjvQmLuWnv6FTGY" />
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C7FZLTKS4Q"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-C7FZLTKS4Q');
</script>
<meta name="description" content="Play Tile World, a remake of Chip's Challenge directly in the browser">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0.0, viewport-fit=cover">
<style>
#spinner,.info-overlay{position:absolute;margin:auto;top:0;bottom:0;left:0;right:0}a{color:#867ae0;text-decoration:none}a:hover{text-decoration:underline}body{color:#ccc;font-family:Monospace;font-size:16px;background-color:#000;margin:0;display:flex;justify-content:center}canvas{overflow:auto;width:100vw}@media screen and (min-width:576px){canvas{height:100vh;width:auto}}@keyframes page-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.info-overlay{text-align:center;width:200px;height:200px;display:none}#spinner{content:"";border-radius:50%;width:48px;height:48px;border-top:2px solid #222;border-right:2px solid #222;border-bottom:2px solid #222;border-left:2px solid #867ae0;transform:translateZ(0);animation:1.1s linear infinite page-loader}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
</style>
</head>
<body>
<div class="center-text" id="status">Downloading...</div>
<div class="center-text">
<a href="https://github.com/TheGLander/tworld-wii/tree/emscripten"
>Check out the source code!</a
>
</div>
<canvas id="canvas" tabindex="-1"></canvas>
<script type="text/javascript">
const statusElement = document.getElementById("status")
const canvasElement = document.getElementById("canvas")
canvasElement.style.display = "none"
canvasElement.addEventListener("contextmenu", () =>
event.preventDefault()
)
const params = new URLSearchParams(location.search)
const mapPath = params.get("map")
const levelId = params.get("levelId")
const solution = params.get("solution")
const lynx = params.get("lynx")
globalThis.Module = {
arguments: ["-p", "-o"],
preRun: [
() => {
if (lynx !== null) Module.arguments.push("-x")
if (!mapPath) return
FS.createPreloadedFile("/", "custom.dat", mapPath, true, true)
Module.arguments.push("/custom.dat")
if (solution || levelId) Module.arguments.push(levelId || "1")
if (solution) {
FS.createPreloadedFile(
"/",
"/customSol.tws",
solution,
true,
true
)
Module.arguments.push("/customSol.tws")
}
},
() => (canvasElement.style.display = "block"),
],
postRun: [],
print: console.log,
printErr: console.error,
canvas: canvasElement,
setStatus: text => (statusElement.innerText = 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."
)
},
}
Module.setStatus("Downloading...")
</script>
{{{ SCRIPT }}}
</body>
</html>