Gradient Background
weekendsuperhero-io-sistine/gradient-backgroundUnverifiedComponent
A ramp-driven gradient wallpaper that recolors with the live glass tint, and lays a fresco preset (sistine/muse/aurora/gloaming) multi-hue palette across the gradient. Pure CSS, crisp at any DPI.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/Weekendsuperhero-io/sistine/main/gradient-background.jsonSource
1"use client";23import { backdropPalette, useBackdropTint } from "@/lib/canvas-background-utils";4import { type GradientGeometry, type GradientShape, type RampGradientAxis, rampGradient, wrapGradient } from "@/lib/oklch-utils";56/**7 * A ramp-driven gradient wallpaper. The gradient is one of our oklch ramps (hue / lightness / tonal8 * / chroma) centered on the live glass-tint color (so it recolors with the theme) with the center as a9 * slightly wider plateau, painted as a `linear`, `radial`, or `conic` gradient. Pure CSS — crisp at any DPI.10 */11export function GradientBackground({12 axis = "tonal",13 hue,14 angle = 90,15 shape = "linear",16 position,17 radialShape,18 radialSize,19}: {20 axis?: RampGradientAxis;21 /** Hue override (deg). When set, drives the gradient color instead of the live --glass-tint-h. */22 hue?: number;23 angle?: number;24 shape?: GradientShape;25} & GradientGeometry) {26 const tint = useBackdropTint();27 // Shared with CanvasBackground: theme-tracking base + fresco palette (the `hue` prop overrides both).28 const { base, frescoColors } = backdropPalette(tint, hue);29 const gradient = frescoColors30 ? wrapGradient(shape, frescoColors.join(", "), {31 angle,32 position,33 radialShape,34 radialSize,35 })36 : rampGradient(axis, base, 5, {37 angle,38 gamut: tint.p3 ? "p3" : "srgb",39 shape,40 position,41 radialShape,42 radialSize,43 });4445 return (46 <div47 className="fixed inset-0 -z-10 pointer-events-none transition-[background] duration-500"48 style={{49 background: gradient,50 }}51 >52 {/* Subtle organic highlight/shadow for depth — plain alpha layers, NO mix-blend-mode: a53 blend-mode element on the page can disable backdrop-filter RENDERING in Chromium, killing54 every glass blur above it (computed styles stay correct, paint silently fails). */}55 <div56 className="absolute inset-0"57 style={{58 background:59 "radial-gradient(circle at 20% 25%, oklch(var(--shadow-highlight) / 0.1) 0%, transparent 45%), radial-gradient(circle at 80% 75%, oklch(var(--shadow-ink) / 0.1) 0%, transparent 45%)",60 }}61 />62 </div>63 );64}
What it pulls in
Other registry items
Files it writes
More from weekendsuperhero-io/sistine
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | weekendsuperhero-io/sistine | Components | Unverified | 5 deps · 4 files | |
| Alertalert | weekendsuperhero-io/sistine | Components | Unverified | 3 deps · 4 files | |
| Alert Dialogalert-dialog | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Auto Foregroundauto-foreground | weekendsuperhero-io/sistine | Components | Unverified | no deps | |
| Avataravatar | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Badgebadge | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Breadcrumbbreadcrumb | weekendsuperhero-io/sistine | Components | Unverified | 5 deps · 4 files | |
| Buttonbutton | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files |
