Ambient Website Background Clouds
Summary
background-clouds is a lightweight, dependency-free JavaScript library that renders an animated low-poly cloud bank behind a website using a single canvas, with support for reduced motion and SPA lifecycle methods.
View Cached Full Text
Cached at: 07/15/26, 04:39 AM
paradise-runner/background-clouds
Source: https://github.com/paradise-runner/background-clouds
background-clouds
background-clouds adds a lightweight, animated low-poly cloud bank behind a website. It uses a single canvas, has no runtime dependencies, pauses motion when the user prefers reduced motion, and exposes lifecycle methods for single-page apps.

Install
npm install background-clouds
Use
import { createCloudBackground } from "background-clouds";
const clouds = createCloudBackground({
canvas: document.querySelector("#background-clouds"),
seed: "my-site",
speed: 0.8,
opacity: 0.9
});
// Later, for example when unmounting a route:
clouds.destroy();
<canvas id="background-clouds" aria-hidden="true"></canvas>
#background-clouds {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
}
The canvas must be available before calling createCloudBackground. The returned controller has start(), stop(), resize(), setSeed(seed), and destroy() methods. seed may be a string or number; using the same seed produces the same cloud layout. speed and opacity default to 1 and accept non-negative numbers.
Options
| Option | Default | Description |
|---|---|---|
canvas | required | The <canvas> element to render into. |
seed | random | A stable string or number for deterministic cloud placement. |
speed | 1 | Drift multiplier. Set to 0 for still clouds. |
opacity | 1 | Overall cloud opacity multiplier. |
pixelRatio | 2 | Maximum device-pixel ratio used for rendering. |
reducedMotion | media query | Set explicitly to override prefers-reduced-motion. |
The package owns only the canvas pixels. Set the canvas’s stacking order, background color, and positioning in your site CSS.
Similar Articles
CSS-Native Parallax Effect
A CSS-native parallax effect using scroll-driven animation timelines, providing a performant and simple utility class with no JavaScript.
Time-based background colour transitions with Temporal and CSS color-mix
This article demonstrates using the Temporal API for local time detection and CSS color-mix to create time-of-day-based background color transitions on a personal website.
Show HN: A CSS 3D Engine (no WebGL)
PolyCSS is a CSS polygon mesh library that renders 3D models as real HTML elements using CSS matrix3d, supporting OBJ/MTL, GLB, and VOX formats with React, Vue, or vanilla JS.
@andreasawires: ~100 MILLION TRIANGLES RENDERED IN THE BROWSER. Casual Nanite-style meshlets on @threejs. GLB drop-in + PBR included.
A developer demonstrates rendering approximately 100 million triangles in the browser using Nanite-style meshlets with Three.js, including GLB drop-in and PBR support.
@VincentLogic: In the past, when doing frontend work, I used to either hunt around for GIFs or write CSS until my head ached just to create a loading animation. Recently I came across this open-source library math-curve-loaders, which generates animations purely using mathematical formulas. I took a look — rose curves, Lissajous curves, and other mathematical figures produce extremely elegant animations. Pure HT…
Introduces an open-source frontend library called math-curve-loaders that utilizes mathematical formulas (such as rose curves and Lissajous curves) to generate elegant loading animations. It is implemented purely with HTML+CSS, has zero dependencies, and comes with a visual debugging panel that allows real-time parameter adjustments and one-click code copying.