-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (34 loc) · 1.14 KB
/
index.html
File metadata and controls
37 lines (34 loc) · 1.14 KB
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
<html>
<head>
<title>codejom.js</title>
<script type="text/javascript" src="Node.js"></script>
<script type="text/javascript" src="Physics.js"></script>
<script type="text/javascript" src="Jom.js"></script>
</head>
<body>
<div>
<input type="button" onclick="jom.highlightNode(parseInt(Math.random()*100));" value="Highlight"/>
</div>
<canvas id="canvasJom" width="1024" height="768"></canvas>
<script language="javascript">
var canvasJom = document.getElementById('canvasJom');
var jom = new Jom(canvasJom);
//shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback, /* DOMElement */ element){
window.setTimeout(callback, 1000 / 60);
};
})();
(function animate()
{
jom.animate();
requestAnimFrame(animate, canvasJom);
})();
</script>
</body>
</html>