Skip to main content
100%

Fork of sole lowit reproduction

✓ Published2🌍 Public
Nnathananiel john agang
Last edited Aug 19, 2024
Created on Aug 19, 2024

This example demonstrates a straightforward technique for populating an SVG canvas with vertical rectangles. The code creates 100 `<rect>` elements, each with a fixed width of 10 pixels, and positions them horizontally by incrementing their x-coordinate by 20 pixels for every iteration. The rectangles span the full height of the viewport, creating a striped pattern. It uses JavaScript to programmatically construct the SVG via the `document.createElementNS` API, setting the `width` and `height` attributes dynamically based on the browser window's inner dimensions. The rendering uses only basic shapes without any external libraries.

AI-generated description

A demonstration of SVG shapes.

MIT Licensed

Similar vizzes