-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell.html
49 lines (41 loc) · 1.44 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flappy Bird</title>
<meta name="description" content="Flappy Bird in C++ using Emscripten">
<meta property="og:url" content="https://github.com/jackkimmins/Flappy-Bird">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="emscripten">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
</div>
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: [],
print: (function () {
return function (text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
};
})(),
canvas: (() => {
const canvas = document.getElementById('canvas');
canvas.addEventListener("webglcontextlost", (e) => {
alert('WebGL context lost. You will need to reload the page.');
e.preventDefault();
}, false);
return canvas;
})()
};
window.onerror = (event) => {
console.error(event);
};
</script>
{{{ SCRIPT }}}
</body>
</html>