-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (71 loc) · 2.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<html>
<head>
<script type="text/javascript" src="js/canvasTutor.js"></script>
<script type="text/javascript" src="js/jslint.js"></script>
<script type="text/javascript" src="js/tutorParser.js"></script>
<script type="text/javascript" src="js/tutorContext.js"></script>
<script type="text/javascript" src="js/tutorExamples.js"></script>
<title>Learn about html5 canvas</title>
<link rel="stylesheet" type="text/css" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/layout.css">
<link rel="stylesheet" type="text/css" href="css/buttons.css">
</head>
<body>
<div id="header">
<div id="branding"></div>
<div id="actions">
<button id="actionBegin" class = "playButton" onclick="ut.action.begin();"></button>
<button id="actionStepBack" class = "playButton" onclick="ut.action.step(-1);"></button>
<button id="actionPlay" class = "playButton" onclick="ut.action.play();"></button>
<button id="actionStepForward" class = "playButton" onclick="ut.action.step(1);"></button>
<button id="actionEnd" class = "playButton" onclick="ut.action.end();"></button>
</div>
</div>
<div id="content">
<div id="content_js" class="window">
<textarea id="jseditor" rows=30>//ctx = canvas context
var i;
ctx.fillStyle="#80ff80";
ctx.beginPath();
ctx.moveTo(5,5);
ctx.lineTo(15,5);
ctx.lineTo(15,20);
ctx.closePath();
ctx.fillStyle="#ff8000";
ctx.fill();
ctx.beginPath();
for(i=0; i<10; i++) {
ctx.moveTo(i*3,i*3);
}
ctx.moveTo(20,5);
ctx.lineTo(30,5);
ctx.lineTo(30,20);
ctx.closePath();
ctx.strokeStyle="#00ff00";
ctx.lineWidth = 3;
ctx.stroke();
</textarea>
<div id="content_examples">
<div class="exampleTitle">Examples</div><br>
<div class="example">
<a onClick="ut.action.example('html');" >html and canvas tag</a><br>
<a onClick="ut.action.example('lines');" >Lines/Paths</a><br>
<a onClick="ut.action.example('lines2');" >Line width and anti-aliasing</a><br>
<a onClick="ut.action.example('arc1');" >Drawing arcs</a><br>
</div>
</div>
</div>
<div id="content_panels">
<div id="panel_normal" class="window">
<div class="canvasDiv"><canvas id="canvasNormalBack" width=50 height=50 ></canvas></div>
<div class="canvasDiv"><canvas id="canvasNormal" width=50 height=50 ></canvas></div>
</div>
<div id="panel_zoomed" class="window">
<div class="canvasDiv"><canvas id="canvasZoomedBack" width=800 height=800 ></canvas></div>
<div class="canvasDiv"><canvas id="canvasZoomed" width=800 height=800 ></canvas></div>
<div class="canvasDiv"><canvas id="canvasZoomedPath" width=800 height=800 ></canvas></div>
</div>
</div>
</div>
</body>
</html>