JSFiddle - React, Tailwind, and code Playground

by steveukx

HTML

<script src="http://lib.ivank.net/ivank.js"></script>
<canvas id="c"></canvas>

CSS

body, html {
    height: 100%;
    background: red;
}
#c {
    width: 600px;
    height: 400px;
}

JavaScript

function Start() {
    var stage = new Stage("c");
    var sp = new Sprite();
    stage.addChild(sp);
    
    //    rectangles
    for(var i=0; i<50; i++) {
        var color = Math.floor(Math.random()*0xffffff);
        sp.graphics.beginFill(color, 0.6);
        sp.graphics.drawRect(Math.random()*800, Math.random()*500, 70, 70);
    }
    
    //    line
    sp.graphics.lineStyle(2, 0xff0000);
    sp.graphics.moveTo(20, 20);
    sp.graphics.lineTo(400, 400);
}
Start();