-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
46 lines (42 loc) · 1.05 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
<html>
<head>
<title>Teeworlds webgl test</title>
<style>
body {
margin: 0px;
overflow: hidden;
}
</style>
</head>
<body>
<script src='jquery-1.10.2.min.js'></script>
<script src='jquery.mousewheel.js'></script>
<script src='gl-matrix.js'></script>
<script src='crc32.min.js'></script>
<script src='zlib.min.js'></script>
<script src='dataviewext.js'></script>
<script src='twdatafile.js'></script>
<script src='twwebgl.js'></script>
<input type='file' id='fileSelect'></input><br>
<canvas id='cnvs'></canvas>
<script>
$(document).ready(function() {
console.log(tw.getParams().map)
var params = tw.getParams();
if (params.map) {
tw.init({ mapUrl: params.map })
} else {
$("#fileSelect").on('change', function(evt) {
var file = evt.target.files[0];
var reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onloadend = function(file) {
tw.init({ mapData: file.target.result})
}
})
}
}
);
</script>
</body>
</html>