-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathZillaLibWasm.html
59 lines (59 loc) · 3.13 KB
/
ZillaLibWasm.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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{ZILLAAPP}}</title>
<style type="text/css">:fullscreen{background:#000;margin:0!important}:full-screen{background:#000;margin:0!important}:-webkit-full-screen{background:#000;margin:0!important}:-moz-full-screen{background:#000;margin:0!important}</style>
</head>
<body style="background:#CCCCCC">
<h1 style="text-align:center">{{ZILLAAPP}}</h1>
<h2 id="zl_status" style="text-align:center">Status: Loading...</h2>
<canvas id="zl_canvas" style="display:block;margin:0 auto 10px" oncontextmenu="event.preventDefault()" width="0" height="0"></canvas>
<div id="zl_popup" style="text-align:center;position:absolute;top:300px;left:0;width:99%;z-index:9;display:none"><div id="zl_popupmsg" style="width:500px;margin:0 auto;padding:20px 10px;background:#444;color:#DDD;border:1px solid white">Please open the following link in a new window to continue<br><br><a id="zl_popup_a" target="_blank" style="color:#88D"></a><br><br><input type="button" value="CLOSE THIS" onclick="document.getElementById('zl_popup').style.display = 'none'"></div></div>
<div id="zl_control" style="text-align:center;display:none"><input type="button" value="fullscreen" onclick="try{ZL.SetFullscreen(true)}catch(e){}"></div>
<hr style="border:0;border-bottom:1px dashed gray;margin:10px 0">
<div id="zl_log"></div>
<script type='text/javascript'>
var ZL =
{
canvas: document.getElementById('zl_canvas'),
//requestWidth: 960,
//requestHeight: 540,
openUrl: function(url)
{
var a = document.getElementById('zl_popup_a');
a.href = a.innerHTML = url;
document.getElementById('zl_popup').style.display = '';
},
print: function(text)
{
var zl_log = document.getElementById('zl_log');
zl_log.innerHTML = text + '<br>' + zl_log.innerHTML;
},
error: function(code, msg)
{
var L = function(code)
{
if (code == 'BOOT') return 'Error during startup. Your browser might not support WebAssembly. Please update it to the latest version.';
if (code == 'WEBGL') return 'Your browser or graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br>Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.';
if (code == 'CRASH') return 'The game crashed.';
if (code == 'MEM') return 'The game ran out of memory.';
};
var zl_status = document.getElementById('zl_status'), zl_control = document.getElementById('zl_control');
zl_control.innerHTML = '<div style="text-align:center;background-color:#FFF;color:#000;padding:1.5em;width:540px;margin:2em auto">' + L(code) + '<br><br>(' + msg + ')</div>';
ZL.canvas.style.display = 'none';
zl_status.innerHTML = '';
zl_control.style.display = '';
},
started: function()
{
var zl_status = document.getElementById('zl_status'), zl_control = document.getElementById('zl_control');
zl_status.innerHTML = '';
zl_control.style.display = '';
},
};
</script>
{{ZILLAAPPSCRIPT}}
</body>
</html>