JSFiddle - React, Tailwind, and code Playground

by Caleb Evans

HTML

<script src="https://raw.github.com/caleb531/jcanvas/master/jcanvas.js"></script>
<canvas width='400' height='400'></canvas>

CSS

canvas {
    
}

JavaScript

$("canvas")
.jCanvas({
  method: 'drawRect',
  width: 150, height: 150
})
.addLayer({
  name: "redBox",
  fillStyle: "#c33",
  x: 200, y: 150,
})
.addLayer({
  name: "greenBox",
  fillStyle: "#585",
  x: 150, y: 200,
})
.addLayer({
  name: "blueBox",
  fillStyle: "#36b",
  x: 280, y: 180,
})
.drawLayers()