-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (39 loc) · 1.49 KB
/
index.html
File metadata and controls
42 lines (39 loc) · 1.49 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
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>Text Animation</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id = "container">
<textarea id = "descriptionText">Enter text here!</textarea>
<canvas id = "animationCanvas"></canvas>
</div>
<script src="js/action.js"></script>
<script src="js/vector.js"></script>
<script src="js/model.js"></script>
<script src="js/display.js"></script>
<script src="js/move.js"></script>
<script>
var display = display();
var move = move();
var canvas = display.getCanvas();
// For now hardcode a model.
var models = [];
var radius = 20;
console.log("width ", canvas.width, " height ", canvas.height, " radius ", radius);
var position = new Vector(canvas.width/2 + radius, canvas.height/2);
var center = new Vector(canvas.width/2, canvas.height/2);
console.log("position ", position);
console.log("center ", center);
var velocity = new Vector(10, 0);
var link = "http://icons.iconarchive.com/icons/iconka/meow/256/cat-walk-icon.png"
var model1 = new Model(position, velocity, center, 0, action.CIRCLE, link);
// var model2 = new Model(new Vector(canvas.width/2 - 255/2, canvas.height-255), new Vector(0, -20), undefined, link);
models.push(model1);
console.log("model position is ", model1.position);
// models.push(model2);
move.step(display, models, 200);
</script>
</body>
</html>