Backgrounds17 / 118
Prism Blades
Curved black lacquer blades sweep in concentric arcs, one tucked behind the next, each catching a light that disperses as it reflects: warm amber, a white-hot core, then cyan and blue, with a fine bright line along every edge and a real bloom on the hot cores. The light follows your cursor so the highlights slide along the blades, a click ripples a flare across them, and scrolling turns the fan.
WebGLWebGLLacquer bladesLacquer bladesDispersionDispersionCursor lightCursor lightGSAPGSAPReduced-motion safeReduced-motion safe
Move the lightClick for a flare
Tweak
LIVELIVELight
#ffa860
#5aa8ff
#c8ccd4
#000000
1.00
1.00
0.70
Blades
140px
Motion
1.00
Interactive
The light follows the cursor, clicks ripple a flare
Usage
Follows your tweaks.
usage.tsx
import { PrismBlades } from "@/components/inreact/prism-blades";
export function Hero() {
return (
<PrismBlades
className="h-screen w-full"
>
{/* optional: your hero content, drawn above the blades */}
</PrismBlades>
);
}Install with the CLI
TS + Tailwind
npx shadcn@latest add https://inreact.vercel.app/r/prism-blades.jsonOr copy the source
Install the dependencies, then save this as components/inreact/prism-blades.tsx.
terminal
npm install gsapcomponents/inreact/prism-blades.tsx
"use client";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useEffect, useRef, type ReactNode } from "react";
gsap.registerPlugin(ScrollTrigger);
/**
* Prism Blades: curved black lacquer blades catching a light that splits into colour.
*
* Concentric sweeping blades of glossy black, one tucked behind the next. Each
* blade is a curved surface, so a light from the upper left catches it in one
* place along its arc, and the highlight runs in a diagonal across the whole set.
* The light disperses as it reflects: warm amber at one end of each highlight,
* a white-hot core, then cyan and blue, with a fine bright line along every
* blade's edge. A real bloom pass lets the hot cores glow; the blacks stay black.
*
* It reacts: the light follows your cursor, so the highlights slide along the
* blades as you move; a click sends a flare rippling out across the blades;
* scrolling turns the whole fan. On load the light rises out of the dark and
* sweeps into place. When idle it drifts slowly, so the colour never sits still.
*
* <PrismBlades className="h-screen w-full">
* <YourHero />
* </PrismBlades>
*
* WebGL: one shader (blade geometry, mirror highlight with dispersion, edge
* fresnel), then bloom at 1/4 and 1/16 size. GSAP drives every motion. Pauses
* off-screen; reduced motion shows a still frame; a CSS gradient without WebGL.
*/
export interface PrismBladesProps {
/** Warm end of the dispersion. */
warm?: string;
/** Cool end of the dispersion. */
cool?: string;
/** Colour of the blades. */
surface?: string;
/** Background colour. */
background?: string;
/** Width of each blade, in px at 1000px tall (scales with the height). */
blade?: number;
/** How strongly the light splits into colour. */
dispersion?: number;
/** Brightness of the light. */
intensity?: number;
/** Strength of the bloom. */
glow?: number;
/** Speed of the idle drift. */
speed?: number;
/** Cursor light, click flare. */
interactive?: boolean;
/** Scroll container if the page does not scroll the window. */
scroller?: Element | null;
/** Foreground content, drawn above the blades. */
children?: ReactNode;
className?: string;
}
const QUAD = `attribute vec2 aQ; varying vec2 vUv; void main(){ vUv = aQ * 0.5 + 0.5; gl_Position = vec4(aQ, 0.0, 1.0); }`;
const SCENE = `
#extension GL_OES_standard_derivatives : enable
precision highp float;
uniform vec2 uRes, uCenter, uBand, uMouse, uPar, uFlareC;
uniform float uTime, uIn, uBlade, uRot, uDisp, uIntensity, uFlare, uFlareAmp, uHover;
uniform vec3 uWarm, uCool, uSurface, uBg;
varying vec2 vUv;
void main() {
float H = uRes.y;
vec2 p = gl_FragCoord.xy / H; // height units, y up
float asp = uRes.x / uRes.y;
// the blades flex softly around the cursor, like webbing pressed by a finger
vec2 dm = p - uMouse;
float press = exp(-dot(dm, dm) / 0.05) * uHover;
vec2 d = p - uCenter - uPar * 0.04;
float r = length(d);
float th = atan(d.y, -d.x) + uRot;
// the blades ripple like silk: slow waves running along them, each blade a little out of step
r += press * 0.045;
r += sin(th * 3.2 - uTime * 0.9 + r * 9.0) * 0.012 + sin(th * 7.0 + uTime * 0.55 - r * 5.0) * 0.005;
// the blades: concentric arcs; u runs 0 at a blade's bright outer (left) edge to 1 where it tucks under the next
float w = uBlade;
float rr = r / w;
float idx = floor(rr);
float u = 1.0 - fract(rr);
float aa = fwidth(rr) * 1.5;
// the light: one soft band falling almost vertically, bowing a little, where the cursor leads it
float y1 = 1.0 - p.y;
// the band bows and sways as it falls, so the light keeps flowing down the blades
float bandX = uBand.x + y1 * 0.16 + y1 * y1 * 0.08 + sin(p.y * 3.0 - uTime * 0.7) * 0.03;
float bw = 0.07;
// each colour lands a little apart: warm to the left and below, cool to the right and above
float dsp = 0.055 * uDisp;
float bR = exp(-pow((p.x - bandX + dsp) / bw, 2.0));
float bG = exp(-pow((p.x - bandX) / bw, 2.0));
float bB = exp(-pow((p.x - bandX - dsp * 1.3) / (bw * 1.25), 2.0));
// brightest near the cursor's height, never dark along the band
float vert = 0.65 + 0.35 * exp(-pow((p.y - uBand.y) / 0.45, 2.0));
// across each blade: the light hugs the outer edge and fades as the surface turns away
float prof = smoothstep(0.0, aa + 0.01, u) * exp(-u / 0.32);
// the shadow where the blade tucks under the next one
float tuck = 1.0 - smoothstep(0.55, 1.0, u) * 0.92;
// the streaks: amber, a white-hot core, cyan-blue, with a prism fringe at the ends
vec3 streak = uWarm * bR * 1.35 + vec3(1.0, 0.97, 0.92) * min(bR, min(bG, bB)) * 0.45 + uCool * bB * 1.25 + vec3(0.25, 1.0, 0.45) * bG * (1.0 - bR) * (1.0 - bB) * 0.5 * uDisp;
vec3 col = streak * prof * vert * 1.25;
// the lacquer bodies: soft grey sheen, brighter toward the edge and in the wide glow of the band
float wide = exp(-pow((p.x - bandX - 0.05) / 0.38, 2.0));
float sheen = (0.03 + 0.1 * exp(-u / 0.4)) * (0.35 + 0.9 * wide);
col += uSurface * sheen * tuck;
// the fine bright line along each blade's edge
float edge = 1.0 - smoothstep(0.0, aa + 0.002, u);
col += mix(vec3(1.0), uCool, 0.3) * edge * (0.14 + bG * 1.4 + wide * 0.12);
col *= tuck;
// the cursor's own soft light on the blades it presses
col += uSurface * press * prof * 0.25;
// a click flare rippling out across the blades
float fr = length(p - uFlareC);
float flare = exp(-pow((fr - uFlare * 1.6) / 0.09, 2.0)) * uFlareAmp;
col += mix(uWarm, uCool, 0.5) * flare * (prof + edge) * 1.2;
col *= uIntensity;
// on load the light rises out of the dark, outer blades first
col *= smoothstep(0.0, 0.4, uIn * 1.5 - (1.0 - p.x / max(asp, 0.01)) * 0.4);
gl_FragColor = vec4(uBg + col, 1.0);
}`;
const BLUR = `
precision mediump float;
uniform sampler2D uTex;
uniform vec2 uStep;
varying vec2 vUv;
void main() {
vec4 c = texture2D(uTex, vUv) * 0.2270;
c += (texture2D(uTex, vUv + uStep * 1.3846) + texture2D(uTex, vUv - uStep * 1.3846)) * 0.3162;
c += (texture2D(uTex, vUv + uStep * 3.2308) + texture2D(uTex, vUv - uStep * 3.2308)) * 0.0703;
gl_FragColor = c;
}`;
const BRIGHT = `
precision mediump float;
uniform sampler2D uTex;
varying vec2 vUv;
void main() {
vec3 c = texture2D(uTex, vUv).rgb;
float l = max(c.r, max(c.g, c.b));
gl_FragColor = vec4(c * smoothstep(0.55, 1.0, l), 1.0);
}`;
const COMPOSITE = `
precision mediump float;
uniform sampler2D uScene, uBloom, uWide;
uniform float uGlow, uTime;
varying vec2 vUv;
float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
void main() {
vec3 sc = texture2D(uScene, vUv).rgb;
vec3 bl = texture2D(uBloom, vUv).rgb * 0.6 + texture2D(uWide, vUv).rgb * 0.4;
vec3 x = sc + bl * uGlow;
vec3 col = x / (1.0 + max(x - 0.85, 0.0) * 1.3);
col = min(col, vec3(1.0));
col += (hash(gl_FragCoord.xy + fract(uTime * 7.0) * 91.0) - 0.5) / 255.0;
gl_FragColor = vec4(col, 1.0);
}`;
const isReducedMotion = () =>
typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
function rgb(hex: string): [number, number, number] {
let h = hex.replace("#", "");
if (h.length === 3) h = h.replace(/./g, (c) => c + c);
const n = parseInt(h, 16) || 0;
return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];
}
export function PrismBlades({
warm = "#ffa860",
cool = "#5aa8ff",
surface = "#c8ccd4",
background = "#000000",
blade = 140,
dispersion = 1,
intensity = 1,
glow = 0.7,
speed = 1,
interactive = true,
scroller,
children,
className,
}: PrismBladesProps) {
const hostRef = useRef<HTMLDivElement>(null);
const props = useRef({ warm, cool, surface, background, blade, dispersion, intensity, glow, speed, interactive });
const redraw = useRef<(() => void) | null>(null);
useEffect(() => {
props.current = { warm, cool, surface, background, blade, dispersion, intensity, glow, speed, interactive };
redraw.current?.();
}, [warm, cool, surface, background, blade, dispersion, intensity, glow, speed, interactive]);
useEffect(() => {
const host = hostRef.current;
if (!host) return;
if (getComputedStyle(host).position === "static") host.style.position = "relative";
const still = isReducedMotion();
const canvas = document.createElement("canvas");
canvas.setAttribute("aria-hidden", "true");
canvas.style.cssText = "position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:pan-y;";
host.prepend(canvas);
const gl = canvas.getContext("webgl", { alpha: false, antialias: false, powerPreference: "high-performance" });
if (!gl) {
const p = props.current;
host.style.background = `repeating-radial-gradient(circle at 140% 55%, ${p.background} 0 70px, ${p.warm}55 78px, ${p.background} 88px)`;
canvas.remove();
return;
}
gl.getExtension("OES_standard_derivatives");
const build = (fs: string) => {
const pr = gl.createProgram()!;
for (const [type, src] of [
[gl.VERTEX_SHADER, QUAD],
[gl.FRAGMENT_SHADER, fs],
] as const) {
const sh = gl.createShader(type)!;
gl.shaderSource(sh, src);
gl.compileShader(sh);
if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) console.error(gl.getShaderInfoLog(sh));
gl.attachShader(pr, sh);
}
gl.linkProgram(pr);
if (!gl.getProgramParameter(pr, gl.LINK_STATUS)) console.error(gl.getProgramInfoLog(pr));
return pr;
};
const sceneProg = build(SCENE);
const blurProg = build(BLUR);
const brightProg = build(BRIGHT);
const compProg = build(COMPOSITE);
const uni = (pr: WebGLProgram, names: string[]) =>
Object.fromEntries(names.map((n) => [n, gl.getUniformLocation(pr, n)])) as Record<string, WebGLUniformLocation | null>;
const US = uni(sceneProg, ["uRes", "uCenter", "uBand", "uMouse", "uPar", "uHover", "uFlareC", "uTime", "uIn", "uBlade", "uRot", "uDisp", "uIntensity", "uFlare", "uFlareAmp", "uWarm", "uCool", "uSurface", "uBg"]);
const UB = uni(blurProg, ["uTex", "uStep"]);
const UR = uni(brightProg, ["uTex"]);
const UC = uni(compProg, ["uScene", "uBloom", "uWide", "uGlow", "uTime"]);
const quad = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, quad);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);
const drawQuad = (pr: WebGLProgram) => {
const a = gl.getAttribLocation(pr, "aQ");
gl.bindBuffer(gl.ARRAY_BUFFER, quad);
gl.enableVertexAttribArray(a);
gl.vertexAttribPointer(a, 2, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.TRIANGLES, 0, 3);
gl.disableVertexAttribArray(a);
};
type Target = { fb: WebGLFramebuffer; tex: WebGLTexture; w: number; h: number };
const target = (tw: number, th: number): Target => {
const tex = gl.createTexture()!;
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, tw, th, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
const fb = gl.createFramebuffer()!;
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
return { fb, tex, w: tw, h: th };
};
let T: { scene: Target; a: Target; b: Target; c: Target; d: Target } | null = null;
const freeTargets = () => {
if (!T) return;
for (const x of Object.values(T)) {
gl.deleteFramebuffer(x.fb);
gl.deleteTexture(x.tex);
}
T = null;
};
let w = 1, h = 1, dpr = 1;
const resize = () => {
dpr = Math.min(window.devicePixelRatio || 1, 2);
w = Math.max(1, host.clientWidth);
h = Math.max(1, host.clientHeight);
canvas.width = Math.round(w * dpr);
canvas.height = Math.round(h * dpr);
const sw = canvas.width, sh = canvas.height;
freeTargets();
T = {
scene: target(sw, sh),
a: target(Math.max(1, sw >> 2), Math.max(1, sh >> 2)),
b: target(Math.max(1, sw >> 2), Math.max(1, sh >> 2)),
c: target(Math.max(1, sw >> 4), Math.max(1, sh >> 4)),
d: target(Math.max(1, sw >> 4), Math.max(1, sh >> 4)),
};
};
resize();
// ---- state: every value GSAP moves; the light direction lives in lx, ly ----
const s = { in: still ? 1 : 0, bx: 0, sweep: still ? 0 : -0.6, by: 0.6, dx: 0, dy: 0, mx: -9, my: -9, px: 0, py: 0, hover: 0, rot: still ? 0 : 0.12, spin: 0, sway: 0, flare: 0, flareAmp: 0, fx: 0, fy: 0 };
let time = 0;
const blurPass = (src: Target, dst: Target, dx: number, dy: number) => {
gl.bindFramebuffer(gl.FRAMEBUFFER, dst.fb);
gl.viewport(0, 0, dst.w, dst.h);
gl.useProgram(blurProg);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, src.tex);
gl.uniform1i(UB.uTex, 0);
gl.uniform2f(UB.uStep, dx / src.w, dy / src.h);
drawQuad(blurProg);
};
const draw = () => {
if (!T) return;
const p = props.current;
const X = T;
const aspect = w / h;
gl.bindFramebuffer(gl.FRAMEBUFFER, X.scene.fb);
gl.viewport(0, 0, X.scene.w, X.scene.h);
gl.useProgram(sceneProg);
gl.uniform2f(US.uRes, X.scene.w, X.scene.h);
// the fan's centre sits off the right edge, a little below the middle, like the reference
// the fan's centre sits below and to the right, so the blades sweep diagonally down to the left like the reference
gl.uniform2f(US.uCenter, aspect * 0.5 + 1.5, -0.1);
gl.uniform2f(US.uBand, aspect * (0.43 + s.bx + s.sweep) + s.dx, s.by + s.dy);
gl.uniform2f(US.uMouse, s.mx, s.my);
gl.uniform2f(US.uPar, s.px, s.py);
gl.uniform1f(US.uHover, s.hover);
gl.uniform2f(US.uFlareC, s.fx, s.fy);
gl.uniform1f(US.uTime, time);
gl.uniform1f(US.uIn, s.in);
gl.uniform1f(US.uBlade, Math.max(20, p.blade) / 1000);
gl.uniform1f(US.uRot, s.rot + s.spin + s.sway);
gl.uniform1f(US.uDisp, p.dispersion);
gl.uniform1f(US.uIntensity, p.intensity);
gl.uniform1f(US.uFlare, s.flare);
gl.uniform1f(US.uFlareAmp, s.flareAmp);
gl.uniform3fv(US.uWarm, rgb(p.warm));
gl.uniform3fv(US.uCool, rgb(p.cool));
gl.uniform3fv(US.uSurface, rgb(p.surface));
gl.uniform3fv(US.uBg, rgb(p.background));
drawQuad(sceneProg);
gl.bindFramebuffer(gl.FRAMEBUFFER, X.a.fb);
gl.viewport(0, 0, X.a.w, X.a.h);
gl.useProgram(brightProg);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, X.scene.tex);
gl.uniform1i(UR.uTex, 0);
drawQuad(brightProg);
blurPass(X.a, X.b, 1, 0);
blurPass(X.b, X.a, 0, 1);
blurPass(X.a, X.c, 1, 0);
blurPass(X.c, X.d, 0, 1);
blurPass(X.d, X.c, 1.8, 0);
blurPass(X.c, X.d, 0, 1.8);
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, canvas.width, canvas.height);
gl.useProgram(compProg);
[X.scene.tex, X.a.tex, X.d.tex].forEach((tex, i) => {
gl.activeTexture(gl.TEXTURE0 + i);
gl.bindTexture(gl.TEXTURE_2D, tex);
});
gl.uniform1i(UC.uScene, 0);
gl.uniform1i(UC.uBloom, 1);
gl.uniform1i(UC.uWide, 2);
gl.uniform1f(UC.uGlow, p.glow);
gl.uniform1f(UC.uTime, time);
drawQuad(compProg);
gl.activeTexture(gl.TEXTURE0);
};
const ro = new ResizeObserver(() => {
resize();
draw();
});
ro.observe(host);
if (still) {
draw();
redraw.current = draw;
return () => {
redraw.current = null;
ro.disconnect();
freeTargets();
canvas.remove();
gl.getExtension("WEBGL_lose_context")?.loseContext();
};
}
// ---- on load: the light sweeps in from the left and the fan settles ----
const intro = gsap
.timeline({ delay: 0.1 })
.to(s, { in: 1, duration: 2.4, ease: "power2.inOut" }, 0)
.to(s, { sweep: 0, duration: 3.2, ease: "expo.out" }, 0.2)
.to(s, { rot: 0, duration: 3.4, ease: "expo.out" }, 0);
// ---- idle: the light breathes back and forth and the fan sways, so it is never still ----
const drift = gsap
.timeline({ repeat: -1, yoyo: true, delay: 3 })
.to(s, { dx: 0.22, dy: 0.25, duration: 4.5, ease: "sine.inOut" })
.to(s, { dx: -0.2, dy: -0.2, duration: 5, ease: "sine.inOut" });
const sway = gsap.to(s, { sway: 0.07, duration: 5, ease: "sine.inOut", yoyo: true, repeat: -1 });
// ---- cursor: the light band glides after it, the blades flex around it, the fan leans ----
const bxTo = gsap.quickTo(s, "bx", { duration: 0.9, ease: "power3" });
const byTo = gsap.quickTo(s, "by", { duration: 0.9, ease: "power3" });
const mxTo = gsap.quickTo(s, "mx", { duration: 0.5, ease: "power3" });
const myTo = gsap.quickTo(s, "my", { duration: 0.5, ease: "power3" });
const pxTo = gsap.quickTo(s, "px", { duration: 2, ease: "power3" });
const pyTo = gsap.quickTo(s, "py", { duration: 2, ease: "power3" });
const hoverTo = gsap.quickTo(s, "hover", { duration: 0.7, ease: "power2.out" });
let first = true;
const move = (e: PointerEvent) => {
if (!props.current.interactive) return;
const r = host.getBoundingClientRect();
const x = (e.clientX - r.left) / r.width, y = (e.clientY - r.top) / r.height;
const hx = (e.clientX - r.left) / r.height, hy = (r.bottom - e.clientY) / r.height;
if (first) {
gsap.set(s, { mx: hx, my: hy });
first = false;
}
mxTo(hx);
myTo(hy);
hoverTo(1);
// the band follows the cursor across, its brightest part at the cursor's height
bxTo((x - 0.43) * 0.9);
byTo(hy);
pxTo(x - 0.5);
pyTo(0.5 - y);
};
const leave = () => {
first = true;
hoverTo(0);
bxTo(0);
byTo(0.6);
pxTo(0);
pyTo(0);
};
// ---- click: a flare ripples out across the blades ----
const down = (e: PointerEvent) => {
if (!props.current.interactive) return;
const r = host.getBoundingClientRect();
s.fx = (e.clientX - r.left) / r.height;
s.fy = (r.bottom - e.clientY) / r.height;
gsap.killTweensOf(s, "flare,flareAmp");
gsap.fromTo(s, { flare: 0 }, { flare: 1, duration: 1.6, ease: "power2.out" });
gsap.timeline().fromTo(s, { flareAmp: 0 }, { flareAmp: 1, duration: 0.15, ease: "power2.out" }).to(s, { flareAmp: 0, duration: 1.5, ease: "power2.in" });
};
host.addEventListener("pointermove", move);
host.addEventListener("pointerleave", leave);
host.addEventListener("pointerdown", down);
// ---- scroll: the fan turns ----
const spinTo = gsap.quickTo(s, "spin", { duration: 1.4, ease: "power3" });
const st = ScrollTrigger.create({
trigger: host,
scroller: scroller ?? undefined,
start: "top bottom",
end: "bottom top",
onUpdate: (self) => {
if (intro.isActive()) return;
spinTo((self.progress - 0.5) * -0.5);
},
});
// ---- loop, only while on screen ----
let visible = true;
let prev = performance.now();
const loop = () => {
const now = performance.now();
const dt = Math.min(0.05, (now - prev) / 1000);
prev = now;
if (!visible) return;
time += dt * props.current.speed;
draw();
};
const io = new IntersectionObserver(([en]) => {
visible = en.isIntersecting;
prev = performance.now();
});
io.observe(host);
gsap.ticker.add(loop);
return () => {
gsap.ticker.remove(loop);
intro.kill();
drift.kill();
sway.kill();
st.kill();
io.disconnect();
ro.disconnect();
host.removeEventListener("pointermove", move);
host.removeEventListener("pointerleave", leave);
host.removeEventListener("pointerdown", down);
gsap.killTweensOf(s);
freeTargets();
canvas.remove();
gl.getExtension("WEBGL_lose_context")?.loseContext();
};
}, [scroller]);
return (
<div ref={hostRef} className={["isolate overflow-hidden", className].filter(Boolean).join(" ")} style={{ background }}>
{children && <div className="relative z-10 h-full">{children}</div>}
</div>
);
}
One prompt, any AI agent
Paste into Claude Code, Codex, Cursor or Windsurf. It carries your tweaks and the full source, so the agent installs it exactly.
Props
13 propswarmstringWarm end of the dispersion.default "#ffa860"default "#ffa860"coolstringCool end of the dispersion.default "#5aa8ff"default "#5aa8ff"surfacestringColour of the soft sheen on the blades.default "#c8ccd4"default "#c8ccd4"backgroundstringBackground colour.default "#000000"default "#000000"bladenumberWidth of each blade, in px at 1000px tall (scales with the height).default 140default 140dispersionnumberHow strongly the light splits into colour.default 1default 1intensitynumberBrightness of the light.default 1default 1glownumberStrength of the bloom.default 0.7default 0.7speednumberSpeed of the idle drift.default 1default 1interactivebooleanCursor light, click flare.default truedefault truescrollerElement | nullScroll container, if the page does not scroll the window.childrenReactNodeForeground content, drawn above the blades.classNamestringSize it, e.g. h-screen w-full.