JSFiddle - React, Tailwind, and code Playground
by Scott Kaye
HTML
<canvas id="canvas"></canvas>
CSS
html, body {
font-size: 0;
margin: 0;
padding: 0;
}
JavaScript
var canvas = document.getElementById("canvas");
var w = window.innerWidth;
var h = window.innerHeight;
canvas.width = w;
canvas.height = h;
var ctx = canvas.getContext("2d");
var particles = [];
var Particle = function() {
this.x = 50;
this.y = 40;
this.radius = 5;
this.vx = 1;
this.vy = 0.5;
};
function animate() {
ctx.fillRect(0, 0, w, h);
requestAnimationFrame(animate);
}
animate();