-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
66 lines (61 loc) · 2.18 KB
/
index.html
File metadata and controls
66 lines (61 loc) · 2.18 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>The Quake Shack</title>
<style>
body{background: #222; color:#ddd; font-family:monospace; font-size:12px; }
canvas{position:fixed;left:0;top:0;display:none}
#loading{display:none;position:fixed}
#error{animation: flash 1s infinite; font-weight: bold;}
#imprint, #imprint > a{color:#999;}
#console { padding: 0; }
#console li { list-style-type: none; white-space: pre; }
@keyframes flash {
0% { color: red; }
50% { color: #ddd; }
100% { color: red; }
}
</style>
<link rel="icon" type="image/png" href="/img/quakeshack.jpeg" />
<link rel="apple-touch-icon" href="/img/quakeshack.jpeg" />
</head>
<body>
<div>
<p id="progress">Loading and initializing engine…</p>
<p id="error"></p>
<ul id="console"></ul>
<p id="imprint">For source code and more information, visit <a href="https://www.quakeshack.dev" target="_blank">www.quakeshack.dev</a>.</p>
<!-- WebGL target -->
<canvas id="mainwindow"></canvas>
<img id="loading" alt="Loading" src="data:image/gif,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
</div>
<script type="module">
import('./source/engine/main-browser.mjs').then((module) => {
// Build configuration, these variables are replaced at build time
// NOTE: These are bare identifiers that get replaced by Vite’s define
const signalingURL = __BUILD_SIGNALING_URL__;
const cdnURL = __BUILD_CDN_URL_PATTERN__;
/** @type {BuildConfig} */
const buildConfig = {
mode: __BUILD_MODE__,
timestamp: __BUILD_TIMESTAMP__,
commitHash: __BUILD_COMMIT_HASH__,
gameDir: __BUILD_GAME_DIR__,
};
return module.default.Launch({
signalingURL,
cdnURL,
}, buildConfig).then(() => {
if (document.getElementById('error').textContent === '' && buildConfig.mode === 'production') {
location.href = 'https://www.quakeshack.dev';
}
}).catch((err) => {
const errorElem = document.getElementById('error');
errorElem.textContent = `${err.message || err}`;
throw err;
});
});
</script>
</body>
</html>