JSFiddle - React, Tailwind, and code Playground
by DaveAlger
HTML
<div id="pagewrap">
<canvas id="emptywebpage"></canvas>
</div>
CSS
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
#emptywebpage {
position: absolute;
top: 0px;
left: 0px;
background: red;
}
#pagewrap {
overflow: hidden;
}
JavaScript
function draw() {
var ctx = document.getElementById('emptywebpage').getContext('2d');
ctx.canvas.width = window.innerWidth;
ctx.canvas.height = window.innerHeight;
//...drawing code...
}
draw();