[READ-ONLY] Mirror of https://github.com/probablykasper/canvas-experiments. Just me learning to use HTML canvas canvas-experiments.kasper.space
canvas html5-canvas website
0

Configure Feed

Select the types of activity you want to include in your feed.

canvas-experiments / 1 / main.js
443 B 19 lines
1window.onload = draw; 2 3function draw() { 4 // Assign canvas el to var 5 var c = document.getElementById("canvas"); 6 var ctx = c.getContext("2d"); 7 var ch = c.clientHeight; 8 var cw = c.clientWidth; 9 10 // fillStyle(r,g,b,alpha) 11 // fillRect(x,y,w,h) 12 13 ctx.fillStyle = "rgba(0, 200, 164, 1)"; 14 var gap = 2; 15 ctx.fillRect(cw/2-25-gap, ch/2-25-gap, 50, 50); 16 17 ctx.fillStyle = "rgba(0, 134, 200, 1)"; 18 ctx.fillRect(cw/2-25+gap, ch/2-25+gap, 50, 50); 19}