-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.html
48 lines (41 loc) · 1.63 KB
/
main.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
<html>
<head>
<title>stickFIG</title>
<script type="text/javascript" src="javascript/main.js"></script>
<script type="text/javascript" src="javascript/drawNode.js"></script>
<script>
alert('Starting on load');
window.onload = function(){
C.init() ; //init Canvas
var MOUSE = { x:0, y:0, dwn:false, mov:false, sel:false } ; //mouse state object
var MENU = { x:0, y:0, active:false, time:0, dur:20, radius:30 } ;
var DEBUG = { toggle:true } ;
function documentMouseMoveHandler(event) {
MOUSE.x = event.clientX - C.x ;
MOUSE.y = event.clientY - C.y ;
}
function documentMouseDownHandler(event) {
MOUSE.dwn = true ;
document.body.style.cursor = 'pointer' ;
}
function documentMouseUpHandler(event) {
MOUSE.dwn = false ;
document.body.style.cursor = 'default' ;
}
alert('ending onload');
function update(){
// C.clearCanvas();
}
(function(){
// Register event listeners
document.addEventListener('mousemove' , documentMouseMoveHandler , false ) ;
document.addEventListener('mousedown' , documentMouseDownHandler , false ) ;
document.addEventListener('mouseup' , documentMouseUpHandler , false ) ;
setInterval(update, 20) ;
})();
}
</script>
</head>
<body id='body' bgcolor="#AAAAAA" align='center'>
</body>
</html>