-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
129 lines (119 loc) · 3.54 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no' />
<style type="text/css">
html {
height: 100%;
background-color: #1d292c;
}
body {
margin: 0;
max-height: 100%;
height: 100%;
overflow: hidden;
background-color: #1d292c;
font-family: Helvetica, arial, sans-serif;
position: relative;
width: 100%;
}
#application-canvas {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#application-canvas.fill-mode-KEEP_ASPECT {
width: 100%;
height: auto;
margin: 0;
}
#application-canvas.fill-mode-FILL_WINDOW {
width: 100%;
height: 100%;
margin: 0;
}
/*canvas {
display: block;
}*/
canvas:focus {
outline: none;
}
#application-splash {
position: absolute;
top: 40%;
width: 30%;
left: 35%;
}
#application-splash img {
width: 100%;
}
@media (min-width: 768px) {
#application-splash {
width: 20%;
left: 40%;
}
}
@media (min-width: 992px) {
#application-splash {
width: 10%;
left: 45%;
}
}
</style>
<title>PlayCanvas</title>
<script src="code.playcanvas.com/playcanvas-0.164.0.min.js"></script>
<script>
var options = {};
(function (options) {
var uri = new pc.URI(window.location.href);
var query = uri.getQuery();
pc.config = pc.config || {};
pc.config['frame'] = {
url: window.location.href
};
pc.extend(options, {
useApi: false,
repository: pc.string.toBool(query.repository),
scriptPrefix: "",
displayLoader: (query.loader && query.loader === 'debug')
});
}(options));
</script>
<script src="data.js"></script>
</head>
<body>
<div id="application-splash">
<a href="https://games.playcanvas.com" target="_blank"><img src="logo.png"/></a>
<div id='application-progress'></div>
</div>
<script src="bootstrap.js"></script>
<script>
window.addEventListener('message', function (e) {
if (e.origin === 'http://apps.playcanvas.com') {
pc.config['frame'] = JSON.parse(e.data);
}
}, false);
// Tell parent window w
window.top.postMessage('frame:listening', '*');
var progress = new pc.ProgressBar(document.getElementById('application-progress'), 2);
progress.attach(document.body);
var bootstrap = new pc.Bootstrap(options);
bootstrap.on('progress', function (v) {
if (v >= progress.value) {
progress.value = v;
}
});
bootstrap.on('loaded', function () {
var splash = document.getElementById('application-splash');
splash.parentNode.removeChild(splash);
});
window.addEventListener("load", function () {
bootstrap.start(353664);
}, false);
</script>
</body>
</html>