<!DOCTYPE html>
<head>
<style>
body {
width: 100%;
height: 100vh;
}
canvas {
object-fit: contain;
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<canvas></canvas>
<script>
const canvas = document.querySelector("canvas");
const gl = canvas.getContext("webgl");
canvas.setAttribute("width", "200");
canvas.setAttribute("height", "100");
gl.clearColor(0, 0, 0.5, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
</script>
</body>