The code is as follows:
const vs = document.getElementById("vs");
const vs_ctx = vs.getContext("2d");
vs_ctx.strokeStyle = "purple";
vs_ctx.lineWidth = 3;
vs_ctx.strokeRect(50, 50, 20, 20);
#vs {
background-color: rgb(17, 17, 17);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>template</title>
<link rel="stylesheet" href="css.css" />
</head>
<body>
<canvas id="vs"></canvas>
<script type="module" src="main.js"></script>
</body>
</html>
I'm using no css to scale or set the canvas, as I read that will make stuff blurry. However, my simple square still is. How do I sharpen this?