Skip to content

Commit

Permalink
Start with a blue box on a canvas.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtaysom committed Feb 25, 2012
0 parents commit b4e9708
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions basics.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Canvas Basics</title>
</head>
<body>
<canvas id="canvas" width="480" height="320"
style="background-color: black;"></canvas>
<script src="basics.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions basics.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');

ctx.fillStyle = 'blue';
ctx.fillRect(40, 60, 150, 100);
2 changes: 2 additions & 0 deletions notes.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
Validate HTML <http://validator.w3.org/>.
Dive into HTML5 canvas <http://diveintohtml5.info/canvas.html>.

0 comments on commit b4e9708

Please sign in to comment.