-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
100 lines (92 loc) · 2.3 KB
/
index.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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Loading Candle</title>
<style>
html {
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
body {
font-family: arial;
margin: 0;
border: 0;
padding: none;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #f5f4f4;
}
canvas {
width: 100%;
height: 100%;
}
#loading {
background-color: white;
padding: 40px;
box-shadow: 0px 0px 48px rgba(0, 0, 0, 0.3);
color: #333;
font-size: 20px;
font-family: 'Roboto';
transition: opacity 2s;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
}
</style>
</head>
<body>
<div id="loading">loading</div>
<canvas id="canvas" oncontextmenu="event.preventDefault(); return false;" tabindex=-1></canvas>
<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);
};
})(),
printErr: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
var canvas = document.getElementById('canvas');
window.addEventListener("resize", function (e) {
if (Module.canvas) {
Module.setCanvasSize(canvas.clientWidth, canvas.clientHeight);
}
});
canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
canvas.width = window.clientWidth;
canvas.height = window.clientHeight;
return canvas;
})(),
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
var loading = document.getElementById('loading');
if (left == 0) {
setTimeout(function(){
loading.style.opacity = 0;
Module.setCanvasSize(canvas.clientWidth, canvas.clientHeight);
document.body.style.backgroundColor = "black";
}, 500);
}
}
};
window.onerror = function(event) {
};
</script>
{{{ SCRIPT }}}
</body>
</html>