Skip to main content
100%

Rotating rect

✓ Published0🌍 Public
AAbdoulaye DIOP
Last edited May 5, 2021
Created on May 5, 2021
Forked from HTML Starter

A small square rotates around a circular path within an SVG canvas, moving at a constant speed. The rotation is driven by a JavaScript loop that updates the rectangle's transform at regular intervals. The code uses the SVG `createSVGTransform` API and `setTranslate` to reposition the element, with `setTimeout` scheduling 100 incremental steps along the circle. The result is a simple, self-contained animation rendered in SVG, with no external libraries beyond plain JavaScript.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes