JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="canvas"></canvas>
CSS
html,
body {
margin: 0;
padding: 0;
}
JavaScript
//global variables...
var canvas, c;
//global event handlers...
window.addEventListener('load', init);
//global functions...
function init() {
canvas = document.getElementById('canvas');
canvas.width = window.innerWidth-1;
canvas.height = window.innerHeight-8;
c = canvas.getContext('2d');
c.width = window.innerWidth-1;
c.height = window.innerHeight-8;
}