-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (40 loc) · 1.25 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
<!DOCTYPE html>
<html>
<head>
<!-- Stylesheet -->
<link rel="stylesheet" type="text/css" href="style.css">
<title>ORBITALS!</title>
</head>
<body>
<div id="container"></div>
<!-- JS Libraries -->
<script type="text/javascript" src="includes/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="includes/raphael.js"></script>
<!-- Scripts -->
<script type="text/javascript" src="js/vector.js"></script>
<script type="text/javascript" src="js/PLANEMATOR.js"></script>
<script type="text/javascript" src="js/planet.js"></script>
<script>
$(function(){
$(PLANEMATOR.paper.canvas).on({
mousedown: function(e){
PLANEMATOR.create_planet(e);
}
});
$('body').on('keypress', function(e){
if (e.which == 32) { // Spacebar
PLANEMATOR.isLooping() ? PLANEMATOR.stopLoop() : PLANEMATOR.loop();
}
if (e.which == 99) PLANEMATOR.clear(); // Clear on 'c'
});
window.onresize = function(e) {
windowWidth = $(window).width();
windowHeight = $(window).height();
}
// Now that planet creation no longer stops and starts looping, initialize it here.
PLANEMATOR.seed(1);
PLANEMATOR.loop();
});
</script>
</body>
</html>