Created
September 23, 2018 13:06
-
-
Save akella/73a6420667eb66dbfc16817fb0fecc14 to your computer and use it in GitHub Desktop.
Starting 2d canvas template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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