Contour Lines
Topographic contour lines drifting over a slowly changing field.
Overview
Contour Lines draws the level lines of a slowly shifting terrain, like a topographic map. Every majorEveryth line is an index contour, drawn thicker and brighter. The hills reshape gently over time rather than sliding across the surface.
The background is transparent and the lines use currentColor at low opacity by default, so the effect follows the text color in light and dark themes. Use it behind a section heading, an empty state, or a data product's landing page.
Installation
Usage
import { ContourLines } from "honestui/shaders"
<div className="relative h-96 bg-background text-foreground">
<ContourLines className="absolute inset-0" fade="radial" />
<div className="relative grid h-full place-items-center">
<h2 className="text-3xl font-medium">Know the terrain.</h2>
</div>
</div>Lines are antialiased at their CSS width on any screen density. Lower levels or raise scale for a calmer map, and use fade to keep the lines away from the edges.
Accessibility
Contour Lines is decorative and its canvas is hidden from assistive technology. Keep text and actions in normal HTML; at the default opacity the lines stay well below body text in contrast.
The effect pauses while it is offscreen or the tab is hidden, and shows a still frame when the user prefers reduced motion. Without WebGL the container shows only its own background.