Skip to main content
100%

Canvas Fiddling

✓ Published0🌍 Public
SStrunck
Last edited Oct 15, 2021
Created on Sep 13, 2021
Forked from HTML Starter

A small animated square glides horizontally across a blank canvas, moving in discrete steps and disappearing from its starting position as it advances. The example demonstrates fundamental Canvas 2D drawing and animation using the HTML5 `getContext('2d')` API, with a rectangular fill drawn via `fillRect` and cleared each frame using `clearRect`. Driven by a `setInterval` timer at 20-millisecond intervals, the square’s position increments by one pixel per frame, creating a simple, linear motion loop without user interaction.

AI-generated description

Learning canvas

MIT Licensed

Similar vizzes