-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJSTileRogue.html
79 lines (62 loc) · 2 KB
/
JSTileRogue.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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JSTileRogue</title>
<style type="text/css">
body { background-color: grey; color: white; font-family: arial; margin: 0; padding: none; text-align: center; }
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
canvas.emscripten { border: 0px none; }
#left { position: absolute; right: 80%; top: 18px; }
#right { position: absolute; left: 80%; top: 18px; }
#page {display: none;}
#loading {
display: block; position: absolute; top: 0; left: 0; z-index: 100; width: 100vw; height: 100vh;
background-color: grey;
background-image: url("loading.gif");
background-repeat: no-repeat;
background-position: center;
}
</style>
</head>
<body>
<script type='text/javascript'>
function onReady(callback) {
var intervalID = window.setInterval(checkReady, 1000);
function checkReady() {
if (document.getElementsByTagName('body')[0] !== undefined) {
window.clearInterval(intervalID);
callback.call(this);
}
}
}
function show(id, value) {
document.getElementById(id).style.display = value ? 'block' : 'none';
}
onReady(function () {
show('page', true);
show('loading', false);
});
</script>
<div id="page">
<div id="left">
<input type="button" value="Fullscreen" onclick="Module.requestFullScreen(false, false)">
</div>
<div id="right">
<input type="button" value="Reload" onclick="location.reload(false)">
</div>
JSTileRogue<br>Google Chrome, Microsoft Edge and Mozilla Firefox work best.<br><br>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: [],
canvas: (function() {var canvas = document.getElementById('canvas'); return canvas;})()
};
</script>
<script async type="text/javascript" src="TileRogue.js"></script>
</div>
<div id="loading"></div>
</body>
</html>