JSFiddle - React, Tailwind, and code Playground

by ling ding

HTML

<script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>
<canvas id="demoCanvas" width="300" height="100">
    alternate content
</canvas>

JavaScript

var stage, circle;
function init() {
    stage = new createjs.Stage("demoCanvas");
    
    circle = stage.addChild(new createjs.Shape());
    circle.graphics.beginFill("red").drawCircle(50,50,50);
    circle.x = 200;
    circle.y = 0;
    
    createjs.Ticker.on("tick", tick);
}

function tick(event) {
    console.log(stage.mouseX + ':' + stage.mouseY);
    circle.alpha = 0.2;
    if (circle.hitTest(stage.mouseX, stage.mouseY)) { 
        circle.alpha = 1; 
    }
    stage.update(event);
}

init();