-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
71 lines (69 loc) · 2.4 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
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title>TODO supply a title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<style>
body,html{
padding: 0;
margin:0;
sbackground-color: #3C292C;
}
</style>
</head>
<body>
<canvas id="game"></canvas>
<script type="text/javascript">
var require = {
waitSeconds: 15,
urlArgs: "bust=" + new Date().getTime()
};
</script>
<script data-main="js/main" src="js/libs/require.min.js"></script>
<script>
var btn = document.createElement("button");
var t = document.createTextNode("pause");
btn.appendChild(t);
btn.style.position = 'fixed';
btn.style.top = '30px';
btn.style.left = '15px';
btn.onclick = function() {
window.game.engine.toggle();
}
document.body.appendChild(btn);
var opt = ['normal', 'normalgrid', 'grid', 'flatgrid', 'experiment'];
var style = document.createElement("select");
style.style.position = 'fixed';
style.style.top = '30px';
style.style.left = '80px';
for (var i = 0; i < opt.length; i++) {
var o = document.createElement('option');
o.value = opt[i];
o.innerHTML = opt[i];
style.appendChild(o);
}
style.onchange = function(val) {
window.game.settings.get(this.value);
}
document.body.appendChild(style);
var range = document.createElement('input');
range.type = 'range';
range.min = 0;
range.max = 100;
range.value = 40;
range.style.position = 'fixed';
range.style.top = '60px';
range.style.left = '15px';
range.onchange = function() {
window.game.grid.setLevel(this.value);
}
document.body.appendChild(range);
</script>
</body>
</html>