Background Controller
weekendsuperhero-io-sistine/background-controllerFreeBlock
Site-wide animated background system — a provider + segmented switcher driving CSS gradient, JS canvas, and pure-CSS pattern backdrops (dots, grid, mesh, starfield, synthwave/moonrise horizons, Pac-Man chase, and more) that recolor with the live glass tint and accent. Exposes density, speed, accent, and a themed "none" base-color.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/Weekendsuperhero-io/sistine/main/public/r/background-controller.jsonSource
1import type { CSSProperties } from "react";23/**4 * Pure-CSS pattern backgrounds — tileable wallpapers built entirely from `background-image` layers5 * (multiple backgrounds + gradients) and SVG `mask-image` silhouettes, all colored off the live6 * OKLCH tint tokens so they recolor with the theme. No canvas, no rAF loop: each static style is a7 * single GPU paint; the animated scenes (synthwave / moonrise grid scroll, the Pac-Man chase) move8 * on compositor-only transforms. Sibling of GradientBackground (CSS gradient) and CanvasBackground9 * (JS canvas).10 */1112export type PatternStyle = "dots" | "grid" | "mesh" | "starfield" | "synthwave" | "moonrise" | "chase";1314export const PATTERN_STYLES: PatternStyle[] = [15 "dots",16 "grid",17 "mesh",18 "starfield",19 "synthwave",20 "moonrise",21 "chase",22];2324/** Patterns that animate (CSS keyframes) — gates the speed control and shares the --pat-dur/--pat-play pace. */25export const ANIMATED_PATTERNS = new Set<PatternStyle>([26 "synthwave",27 "moonrise",28 "chase",29]);3031/** Horizon scenes with a sun/moon disc that can be placed left / center / right. */32export const DISC_PATTERNS = new Set<PatternStyle>([33 "synthwave",34 "moonrise",35]);3637/** Star-field density — how many of the star field's points render (a "range of stars"). */38export type PatternDensity = "sparse" | "medium" | "dense";39export const PATTERN_DENSITIES: PatternDensity[] = [40 "sparse",41 "medium",42 "dense",43];44const STAR_COUNT: Record<PatternDensity, number> = {45 sparse: 16,46 medium: 33,47 dense: 50,48};49/** Chase pellet-cell scale per density — sparse = larger cells (fewer per screen), dense = smaller (more). */50const DENSITY_SCALE: Record<PatternDensity, number> = {51 sparse: 1.4,52 medium: 1,53 dense: 0.68,54};55/** Tile-size scale for the geometric tiles (dots / grid) — a much airier ladder: the old sparse (1.4)56 * is the new DENSE, with medium and sparse extrapolated outward on the same ~1.4× step. */57const TILE_SCALE: Record<PatternDensity, number> = {58 sparse: 2.8,59 medium: 2,60 dense: 1.4,61};6263// SVG silhouettes as mask sources. White fill + transparent ground works whether the browser samples64// the mask by alpha or luminance. Wrapped in url(...) after encoding so it's a valid CSS value.65const svgMask = (body: string, viewBox = "0 0 100 100") =>66 `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='${viewBox}' fill='#fff'>${body}</svg>`)}")`;6768// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from weekendsuperhero-io/sistine
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Authenticationauthentication | weekendsuperhero-io/sistine | Blocks | Free | no deps | |
| Calendarcalendar-block | weekendsuperhero-io/sistine | Blocks | Free | 1 dep | |
| Chartchart-block | weekendsuperhero-io/sistine | Blocks | Free | 1 dep | |
| Dashboarddashboard | weekendsuperhero-io/sistine | Blocks | Free | 2 deps | |
| Data Tabledata-table | weekendsuperhero-io/sistine | Blocks | Free | 2 deps | |
| Forgot Passwordforgot-password | weekendsuperhero-io/sistine | Blocks | Free | 1 dep | |
| Sign Upsignup | weekendsuperhero-io/sistine | Blocks | Free | no deps |
