JSFiddle - React, Tailwind, and code Playground

by jeffreybiles

HTML

<html>
<body>
    <canvas id="myCanvas" width="400" height="300"></canvas>
</body>

CSS

#myCanvas {background-color: #999;}

JavaScript

//1.1 Intro

var x = 200; 
var y = 100;
var radius = 20;
var color = 'black'; 

main = function(){ 
    drawCircle(x, y, radius, color); 
}

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
//it's safe to ignore everything past this point for now
    
drawCircle = function(x, y, radius, color) {
    var canvas = document.getElementById("myCanvas");
    var ctx = canvas.getContext("2d");
    ctx.fillStyle = color;
    ctx.beginPath();
    ctx.arc(x, y, radius, 0, Math.PI * 2, false);
    ctx.fill();
}
    
main()