-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (65 loc) · 2.8 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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--Set visual viewport size for mobile devices to the device size,
witch results in a scale of 1 and a 1:1 mapping between CSS pixels
and Qt device independent pixels. -->
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=0"/>
<title>Owo</title>
<style>
/* Make the html body cover the entire (visual) viewport with no scroll bars. */
html, body { padding: 0; margin: 0; overflow:hidden; height: 100% }
/* Make the canvas cover the entire body */
canvas { height:100%; width:100%; }
</style>
</head>
<body onload="init()">
<figure style="overflow:visible;" id="qtspinner">
<center style="margin-top:1.5em; line-height:150%">
<img src="qtlogo.svg" width="320" height="200" style="display:block"></img>
<strong>Qt for WebAssembly: Owo</strong>
<div id="qtstatus"></div>
<noscript>JavaScript is disabled. Please enable JavaScript to use this application.</noscript>
</center>
</figure>
<canvas id="qtcanvas"></canvas>
<script type='text/javascript'>
let qtLoader = undefined;
function init() {
var spinner = document.querySelector('#qtspinner');
var canvas = document.querySelector('#qtcanvas');
var status = document.querySelector('#qtstatus')
qtLoader = QtLoader({
canvasElements : [canvas],
showLoader: function(loaderStatus) {
spinner.style.display = 'block';
canvas.style.display = 'none';
status.innerHTML = loaderStatus + "...";
},
showError: function(errorText) {
status.innerHTML = errorText;
spinner.style.display = 'block';
canvas.style.display = 'none';
},
showExit: function() {
status.innerHTML = "Application exit";
if (qtLoader.exitCode !== undefined)
status.innerHTML += " with code " + qtLoader.exitCode;
if (qtLoader.exitText !== undefined)
status.innerHTML += " (" + qtLoader.exitText + ")";
spinner.style.display = 'block';
canvas.style.display = 'none';
},
showCanvas: function() {
spinner.style.display = 'none';
canvas.style.display = 'block';
},
});
qtLoader.loadEmscriptenModule("Owo");
}
</script>
<script type="text/javascript" src="qtloader.js"></script>
</body>
</html>