Random Squares
✓ Published1🌍 Public
Random Squares demonstrates SVG shape generation by populating a 1000×1000 canvas with 500 randomly positioned, sized, and colored rectangles. Each `<rect>` element receives a random RGB fill, a random x/y coordinate within the viewport, and a random width and height up to 50 pixels. The code uses vanilla JavaScript with `Math.random()` to compute values and `document.querySelector('svg').innerHTML` to append shapes directly to the SVG DOM. The result is a dense, chaotic mosaic of overlapping squares with no underlying data or interaction, showcasing basic SVG rendering through a simple procedural loop.
AI-generated descriptionDemonstration of SVG shapes.
MIT Licensed