20 lines
493 B
HTML
20 lines
493 B
HTML
|
<canvas id="mainCanvas"></canvas>
|
||
|
<script>
|
||
|
|
||
|
function x(){
|
||
|
|
||
|
const body = document.querySelector("body"),
|
||
|
canvas = document.querySelector("canvas"),
|
||
|
context = canvas.getContext("2d");
|
||
|
|
||
|
canvas.setAttribute("width", body.offsetWidth);
|
||
|
canvas.setAttribute("height", body.offsetHeight);
|
||
|
|
||
|
context.clearRect(0, 0, body.offsetWidth, body.offsetHeight);
|
||
|
|
||
|
requestAnimationFrame(x);
|
||
|
};
|
||
|
|
||
|
requestAnimationFrame(x);
|
||
|
|
||
|
</script>
|