JSFiddle - React, Tailwind, and code Playground

by ktstowell

HTML

<h1>canvas scaling experiment</h1>
<button onclick="">Scale Up</button>
<button onclick="">Scale Down</button>
<div>
    <canvas width="350px" height="200px"></canvas>
</div>

CSS

canvas {
    border: 1px solid #333;
}

JavaScript

var canvas  = document.querySelectorAll('canvas')[0];
var ctx = canvas.getContext('2d');

var isMouseDownOnCanvas = false;

console.log(canvas, ctx);