Skip to content

Instantly share code, notes, and snippets.

@esmitt
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esmitt/9473127 to your computer and use it in GitHub Desktop.
Save esmitt/9473127 to your computer and use it in GitHub Desktop.
This is a basic template to start drawing in the canvas defined in canvas2D and using 2 method to drawing (Set Pixel and Javascript).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>This is my test</title>
<style>
body
{
background: #eeeeee;
}
#canvas2D
{
margin: 10px;
-moz-box-shadow: 0px 0px 20px #ccc;
-webkit-box-shadow: 0px 0px 20px #ccc;
box-shadow: 0px 0px 20px #ccc;
cursor: pointer;
border: thin solid rgba(0.8, 0.8, 0.8, 0.5);
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-webkit-touch-callout: none;
-webkit-user-drag: none;
}
#canvas2D:active
{
cursor:crosshair;
}
</style>
</head>
<body onload="main()">
<select id = "method">
<option value = "0">Set Pixel</option>
<option value = "1">Javascript</option>
</select><br>
<canvas id="canvas2D" width="400" height="400">
Please use a browser
</canvas>
<script src="drawFigures.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment