JSFiddle - React, Tailwind, and code Playground

by Amanda Williamson

HTML

<canvas id="canvas" width="200" height="200"></canvas>

JavaScript

var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');

ctx.fillStyle = 'blue';
ctx.fillRect(0,0,160,160);
                 
ctx.fillStyle = 'white';     
ctx.globalAlpha = 0.3; 
ctx.fillRect(10,10,140,140);
      
ctx.fillRect(20,20,120,120);

ctx.fillRect(30,30,100,100);

ctx.fillRect(40,40,80,80);

ctx.fillRect(50,50,60,60);

ctx.fillRect(60,60,40,40);

ctx.fillRect(70,70,20,20);