-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintersection.html
69 lines (53 loc) · 1.6 KB
/
intersection.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 PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta charset="UTF-8">
<title>Intersection</title>
</head>
<link rel="stylesheet" type="text/css" href="intersection.css">
<body id="body">
<div id="bottom"></div>
<div id="middle"></div>
<div id="top"></div>
<div id="buttons"></div>
<script>
"use strict";
function load(urls, callback) {
function load_single(url, callback){
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function() {
if (script.readyState == "loaded" ||
script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = callback;
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
function load_one(index) {
if (index==urls.length) {
console.log("Done, starting game");
callback();
} else {
load_single(urls[index], function() {
console.log("Loaded '"+urls[index]);
load_one(index+1);
});
}
}
load_one(0);
}
var SMALL = 0.01;
var SMALL2 = SMALL*SMALL;
function assert(succeeded, string) { if (!succeeded) { console.error(string); } }
// TODO loading is currently in-order, while some files can be loaded synchronously, which would be faster
load(["Cplx.js", "CPPos.js", "Storage.js", "Graphics.js", "Gizmo.js", "Tool.js", "Interface.js", "CompoundTool.js", "Construction.js", "Stamp.js", "State.js", "main.js"], function() { main(); });
</script>
</body>
</html>