JSFiddle - React, Tailwind, and code Playground

by victorrseloy

HTML

<canvas id="canvas_ract" width="500" height="500">
    <canvas>

CSS

#canvas_ract {
    border:1px solid black;
}

JavaScript

var myCanvas = document.getElementById('canvas_ract');
var ctx = myCanvas.getContext("2d");
ctx.beginPath();
ctx.fillStyle = "#FF0000";
//ctx.strokeStyle = "#0000bb";
ctx.arc(200, 100, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.font = "30px Arial";

ctx.fillStyle = "pink";
ctx.fillRect(30, 40, 200, 100);
ctx.fillStyle = "green";
ctx.fillText("Hello World", 45, 90);