-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (29 loc) · 792 Bytes
/
index.html
File metadata and controls
32 lines (29 loc) · 792 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>PureScript Free Turtle</title>
<style type="text/css">
body {
background: #eee;
}
canvas {
background: #fff;
}
</style>
</head>
<body>
<canvas id="turtleCanvas">
</canvas>
<script type="text/javascript">
var canvas = document.getElementById('turtleCanvas'),
context = canvas.getContext('2d');
// set canvas dimensions through js; doing it by css only will stretch the drawing
canvas.setAttribute('width', window.innerWidth);
canvas.setAttribute('height', 400);
// put origin at center
context.translate(canvas.width/2, canvas.height/2);
</script>
<script src="index.js"></script>
</body>
</html>