Skip to content

Instantly share code, notes, and snippets.

@akella
Created September 23, 2018 13:06
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 akella/73a6420667eb66dbfc16817fb0fecc14 to your computer and use it in GitHub Desktop.
Save akella/73a6420667eb66dbfc16817fb0fecc14 to your computer and use it in GitHub Desktop.
Starting 2d canvas template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Canvas</title>
<style>*{margin:0;padding:0}</style>
</head>
<body>
<script>
let canv = document.createElement('canvas');
let ctx = canv.getContext('2d');
canv.width = window.innerWidth;
canv.height = window.innerHeight;
document.body.appendChild(canv);
function draw(t){
console.log(t);
requestAnimationFrame(draw);
}
draw();
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment