{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer-glow",
  "type": "registry:ui",
  "title": "Footer Glow",
  "description": "A glowing footer backdrop with an interactive halftone wordmark.",
  "files": [
    {
      "path": "registry/new-york/ui/footer-glow.tsx",
      "content": "\"use client\";\n\nimport Image from \"next/image\";\nimport type * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { FooterWordmark } from \"@/registry/new-york/ui/footer-wordmark\";\nimport { GrainOverlay } from \"@/registry/new-york/ui/grain-overlay\";\n\nexport interface FooterGlowProps {\n\t/** The word rendered as the halftone dot grid. */\n\ttext: string;\n\t/** Optional image mark composed at the same height, left of the text. */\n\tlogoSrc?: string;\n\t/** Optional wallpaper image. Falls back to a CSS glow when omitted. */\n\tbackgroundSrc?: string;\n\t/** Accent color of the fallback CSS glow. */\n\tglowColor?: string;\n\t/** Font classes for the wordmark lettering (any family your site uses). */\n\tfontClassName?: string;\n\t/** Content rendered over the glow, below the wordmark (e.g. a bottom bar). */\n\tchildren?: React.ReactNode;\n\tclassName?: string;\n}\n\n/**\n * Glowing footer backdrop with an interactive halftone wordmark: a radial\n * glow (or wallpaper image) rising from the bottom edge, film grain to break\n * up banding, and a canvas-drawn dot-grid lockup that swells around the\n * pointer and ripples on click. Drop it at the bottom of your own footer.\n * Designed dark: the glow and blend modes assume a dark page beneath.\n */\nexport function FooterGlow({\n\ttext,\n\tlogoSrc,\n\tbackgroundSrc,\n\tglowColor = \"#00a3ff\",\n\tfontClassName,\n\tchildren,\n\tclassName,\n}: FooterGlowProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\"relative w-full overflow-hidden bg-black\", className)}\n\t\t\trole=\"presentation\"\n\t\t>\n\t\t\t{backgroundSrc ? (\n\t\t\t\t<Image\n\t\t\t\t\tsrc={backgroundSrc}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tfill\n\t\t\t\t\tsizes=\"100vw\"\n\t\t\t\t\tclassName=\"pointer-events-none z-0 origin-bottom scale-150 select-none object-cover object-bottom\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName=\"pointer-events-none absolute inset-0 z-0\"\n\t\t\t\t\t// Two layers: a white-hot core hugging the bottom edge inside\n\t\t\t\t\t// a tall ambient wash. The wash must stay strong behind the\n\t\t\t\t\t// whole wordmark — its dots are overlay-blended, so they only\n\t\t\t\t\t// read bright against a bright backdrop and vanish over black.\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackground: [\n\t\t\t\t\t\t\t`radial-gradient(55% 55% at 50% 112%, color-mix(in srgb, ${glowColor} 55%, white) 0%, transparent 70%)`,\n\t\t\t\t\t\t\t`radial-gradient(95% 150% at 50% 115%, ${glowColor} 0%, color-mix(in srgb, ${glowColor} 85%, transparent) 32%, color-mix(in srgb, ${glowColor} 40%, transparent) 58%, transparent 82%)`,\n\t\t\t\t\t\t].join(\", \"),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{/* Fade the top edge into the page above so the backdrop never\n\t\t\t    reads as a hard line against the content above. */}\n\t\t\t<div className=\"pointer-events-none absolute inset-x-0 top-0 z-10 h-24 bg-gradient-to-b from-background via-background/50 to-transparent\" />\n\n\t\t\t{/* Film grain breaks up gradient banding in the glow. */}\n\t\t\t<GrainOverlay variant=\"surface\" className=\"z-20\" />\n\n\t\t\t{/* Content. Deliberately NO z-index on this wrapper: a stacking\n\t\t\t    context here would isolate blending and leave the wordmark's\n\t\t\t    mix-blend-mode with an empty backdrop. */}\n\t\t\t<div className=\"relative flex flex-col gap-8 px-6 pt-12 pb-8 sm:px-8 lg:px-10\">\n\t\t\t\t{/* Slightly inset so the lockup never touches the edges. */}\n\t\t\t\t<FooterWordmark\n\t\t\t\t\ttext={text}\n\t\t\t\t\tlogoSrc={logoSrc}\n\t\t\t\t\tfontClassName={fontClassName}\n\t\t\t\t\tclassName=\"mx-auto w-[88%] max-w-6xl\"\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/new-york/ui/footer-wordmark.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n/* -------------------------------------------------------------------------\n * Tuning constants\n * ---------------------------------------------------------------------- */\n\n/** Gap between the mark and the lettering, as a fraction of the row height. */\nconst GAP_RATIO = 0.22;\nconst TEXT_RGB = \"#e4e4e7\";\nconst COVERAGE_FLOOR = 0.08;\nconst MIN_DOT_RADIUS = 0.45;\n\n// Pointer-interaction tuning.\n/** Extra swell at the pointer, fading to zero over RIPPLE_RADIUS. */\nconst RIPPLE_LIFT = 0.55;\nconst RIPPLE_RADIUS = 190;\n/** Seconds for the ripple center to catch up to the cursor (exp smoothing). */\nconst CURSOR_FOLLOW_TAU = 0.06;\n/** Seconds for a dot's radius to reach its target swell (exp smoothing). */\nconst SWELL_TAU = 0.09;\n/** Radius delta (css px) under which a dot counts as settled. */\nconst SETTLE_EPSILON = 0.01;\n\n// Click-ripple tuning.\n/** Peak swell of the click wave at its origin. */\nconst CLICK_AMP = 0.55;\n/** Wavefront speed across the wordmark, css px per second. */\nconst CLICK_SPEED = 900;\n/** Seconds for one dot to complete its swell bump as the front passes. */\nconst CLICK_RISE = 0.32;\n/** Fraction of the amplitude lost at the far edge of the canvas. */\nconst CLICK_EDGE_FALLOFF = 0.45;\n/** Opacity of the un-blended white layer at the peak of the click wave. */\nconst CLICK_GLOW_ALPHA = 0.9;\n/** Below this the white layer is invisible: skip the fill entirely. */\nconst GLOW_EPSILON = 0.02;\n\n/* -------------------------------------------------------------------------\n * Internal types\n * ---------------------------------------------------------------------- */\n\ninterface WordRaster {\n\tpixels: Uint8ClampedArray;\n\twidth: number;\n\theight: number;\n}\n\ninterface Dot {\n\tx: number;\n\ty: number;\n\tbase: number;\n\tradius: number;\n\t/** 0..1 share of the click wave at this dot, drives the white layer. */\n\tglow: number;\n}\n\n/** A click-ripple wavefront expanding from a pointerdown point. */\ninterface ClickWave {\n\tx: number;\n\ty: number;\n\t/** performance.now() at pointerdown. */\n\tstart: number;\n}\n\n/** Per-frame inputs for {@link updateDot}: everything the physics needs. */\ninterface DotUpdateContext {\n\tnow: number;\n\tcssW: number;\n\tease: number;\n\tcursorX: number;\n\tcursorY: number;\n\tpointerInside: boolean;\n\twaves: ClickWave[];\n}\n\n/* -------------------------------------------------------------------------\n * Halftone raster + physics\n * ---------------------------------------------------------------------- */\n\nfunction smoothstep(a: number, b: number, x: number): number {\n\tconst t = Math.min(1, Math.max(0, (x - a) / (b - a)));\n\treturn t * t * (3 - 2 * t);\n}\n\n/**\n * Ease one dot toward its target radius for this frame and update its glow.\n * Returns true when the dot has settled (no further animation needed).\n */\nfunction updateDot(dot: Dot, ctxIn: DotUpdateContext): boolean {\n\tconst { now, cssW, ease, cursorX, cursorY, pointerInside, waves } = ctxIn;\n\tconst dist = Math.hypot(dot.x - cursorX, dot.y - cursorY);\n\t// Only dots inside the cursor's falloff circle are affected.\n\tconst ripple = RIPPLE_LIFT * smoothstep(RIPPLE_RADIUS, 0, dist);\n\tlet target = pointerInside ? ripple : 0;\n\n\t// Sum every active click wave: each dot swells on a sin bump as the\n\t// wavefront reaches it, so the ripple physically travels the lockup.\n\tlet click = 0;\n\tfor (const wave of waves) {\n\t\tconst d = Math.hypot(dot.x - wave.x, dot.y - wave.y);\n\t\tconst phase = ((now - wave.start) / 1000 - d / CLICK_SPEED) / CLICK_RISE;\n\t\tif (phase < 0 || phase > 1) continue;\n\t\tconst edgeFalloff = 1 - CLICK_EDGE_FALLOFF * smoothstep(0, cssW, d);\n\t\tclick += CLICK_AMP * edgeFalloff * Math.sin(Math.PI * phase);\n\t}\n\ttarget += click;\n\n\tconst targetRadius = dot.base * (1 + target);\n\tdot.radius += (targetRadius - dot.radius) * ease;\n\t// The white layer tracks the click wave only: hovering swells the dots\n\t// but must not repaint them.\n\tdot.glow = Math.min(1, click / CLICK_AMP);\n\treturn Math.abs(targetRadius - dot.radius) <= SETTLE_EPSILON;\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t\timg.src = src;\n\t});\n}\n\n/**\n * Compose the lockup: optional logo mark and the word at the SAME height,\n * side by side, sized so the whole row spans cssW, then return pixel data.\n */\nfunction rasterizeLockup(\n\tfamily: string,\n\tword: string,\n\tlogo: HTMLImageElement | null,\n\tcssW: number,\n): WordRaster | null {\n\tconst off = document.createElement(\"canvas\");\n\tconst ctx = off.getContext(\"2d\", { willReadFrequently: true });\n\tif (!ctx) return null;\n\n\t// Measure at 100px to solve the font size where logo + gap + text == cssW\n\t// with the logo height locked to the glyph height.\n\tctx.font = `700 100px ${family}`;\n\tconst m100 = ctx.measureText(word);\n\tconst h100 = m100.actualBoundingBoxAscent + m100.actualBoundingBoxDescent;\n\tconst w100 = m100.width;\n\tconst logoAspect = logo ? logo.naturalWidth / logo.naturalHeight : 0;\n\tconst prefix = logo ? logoAspect + GAP_RATIO : 0;\n\tconst fontPx = (100 * cssW) / (h100 * prefix + w100);\n\n\tctx.font = `700 ${fontPx}px ${family}`;\n\tconst m = ctx.measureText(word);\n\tconst ascent = m.actualBoundingBoxAscent;\n\tconst rowH = ascent + m.actualBoundingBoxDescent;\n\tconst logoW = rowH * logoAspect;\n\n\toff.width = Math.ceil(cssW);\n\toff.height = Math.ceil(rowH);\n\tctx.font = `700 ${fontPx}px ${family}`;\n\tctx.textBaseline = \"alphabetic\";\n\tif (logo) ctx.drawImage(logo, 0, 0, logoW, rowH);\n\tctx.fillStyle = TEXT_RGB;\n\tctx.fillText(word, logo ? logoW + rowH * GAP_RATIO : 0, ascent);\n\n\treturn {\n\t\tpixels: ctx.getImageData(0, 0, off.width, off.height).data,\n\t\twidth: off.width,\n\t\theight: off.height,\n\t};\n}\n\ninterface CellSample {\n\tcoverage: number;\n\tr: number;\n\tg: number;\n\tb: number;\n}\n\n/** 3x3 area sample for one grid cell: alpha coverage plus the alpha-weighted\n * average color, so any logo shading carries through into the dots. */\nfunction sampleCell(\n\traster: WordRaster,\n\tcol: number,\n\trow: number,\n\tcell: number,\n): CellSample {\n\tlet aAcc = 0;\n\tlet rAcc = 0;\n\tlet gAcc = 0;\n\tlet bAcc = 0;\n\tfor (let sy = 0; sy < 3; sy++) {\n\t\tfor (let sx = 0; sx < 3; sx++) {\n\t\t\tconst px = Math.min(\n\t\t\t\traster.width - 1,\n\t\t\t\tMath.floor(col * cell + ((sx + 0.5) * cell) / 3),\n\t\t\t);\n\t\t\tconst py = Math.min(\n\t\t\t\traster.height - 1,\n\t\t\t\tMath.floor(row * cell + ((sy + 0.5) * cell) / 3),\n\t\t\t);\n\t\t\tconst i = (py * raster.width + px) * 4;\n\t\t\tconst a = raster.pixels[i + 3];\n\t\t\taAcc += a;\n\t\t\trAcc += raster.pixels[i] * a;\n\t\t\tgAcc += raster.pixels[i + 1] * a;\n\t\t\tbAcc += raster.pixels[i + 2] * a;\n\t\t}\n\t}\n\tconst coverage = aAcc / (9 * 255);\n\treturn {\n\t\tcoverage,\n\t\tr: aAcc > 0 ? Math.round(rAcc / aAcc) : 0,\n\t\tg: aAcc > 0 ? Math.round(gAcc / aAcc) : 0,\n\t\tb: aAcc > 0 ? Math.round(bAcc / aAcc) : 0,\n\t};\n}\n\n/** Area-true halftone: uniform grid, fully opaque dots. Tone is carried by\n * dot size alone; luminance is contrast-stretched then posterized so flat\n * brand shades read as distinctly different dot sizes. */\nfunction buildDots(\n\traster: WordRaster,\n\tcssW: number,\n\tcssH: number,\n\tcell: number,\n): Dot[] {\n\t// High fill ratio: with the fine grid the letters need dense ink to read\n\t// bright through the overlay blend; the sub-cell gap still keeps the dot\n\t// texture visible (this matches the landing page render).\n\tconst maxR = cell * 0.42;\n\tconst cols = Math.floor(cssW / cell);\n\tconst rows = Math.floor(raster.height / cell);\n\tconst dots: Dot[] = [];\n\n\tfor (let row = 0; row < rows; row++) {\n\t\tfor (let col = 0; col < cols; col++) {\n\t\t\tconst { coverage, r, g, b } = sampleCell(raster, col, row, cell);\n\t\t\tif (coverage <= COVERAGE_FLOOR) continue;\n\n\t\t\tconst x = (col + 0.5) * cell;\n\t\t\tconst y = (row + 0.5) * cell;\n\t\t\tconst t = Math.min(1, y / cssH);\n\n\t\t\tconst lum = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n\t\t\tconst stretched = Math.min(1, Math.max(0, (lum - 0.1) / 0.55));\n\t\t\tconst toneMul = stretched < 0.38 ? 0.28 : stretched < 0.72 ? 0.62 : 1.0;\n\t\t\tconst base =\n\t\t\t\tmaxR *\n\t\t\t\tMath.sqrt(coverage) *\n\t\t\t\ttoneMul *\n\t\t\t\t(1 - 0.7 * smoothstep(0.2, 1.05, t));\n\t\t\tif (base < MIN_DOT_RADIUS) continue;\n\n\t\t\tdots.push({ x, y, base, radius: base, glow: 0 });\n\t\t}\n\t}\n\treturn dots;\n}\n\n/** Draw every dot as one batched path. */\nfunction drawDots(ctx: CanvasRenderingContext2D, dots: Dot[]): void {\n\tctx.fillStyle = \"rgba(255,255,255,0.9)\";\n\tctx.beginPath();\n\tfor (const dot of dots) {\n\t\tctx.moveTo(dot.x + dot.radius, dot.y);\n\t\tctx.arc(dot.x, dot.y, dot.radius, 0, Math.PI * 2);\n\t}\n\tctx.fill();\n}\n\n/** White layer that rides the click wave, on its own un-blended canvas, so\n * the wave reads as plain white as it travels. Dots are bucketed by opacity\n * so the layer draws in a handful of batched paths. */\nfunction drawGlow(ctx: CanvasRenderingContext2D, dots: Dot[]): void {\n\tconst buckets = new Map<number, Dot[]>();\n\tfor (const dot of dots) {\n\t\tif (dot.glow < GLOW_EPSILON) continue;\n\t\tconst step = Math.round(dot.glow * 10);\n\t\tconst bucket = buckets.get(step);\n\t\tif (bucket) bucket.push(dot);\n\t\telse buckets.set(step, [dot]);\n\t}\n\n\tfor (const [step, bucketDots] of buckets) {\n\t\tctx.fillStyle = `rgba(255,255,255,${(step / 10) * CLICK_GLOW_ALPHA})`;\n\t\tctx.beginPath();\n\t\tfor (const dot of bucketDots) {\n\t\t\tctx.moveTo(dot.x + dot.radius, dot.y);\n\t\t\tctx.arc(dot.x, dot.y, dot.radius, 0, Math.PI * 2);\n\t\t}\n\t\tctx.fill();\n\t}\n}\n\n/**\n * Pointer interaction: dots near the cursor swell and trail it, and a\n * pointerdown sends a wavefront rippling across the lockup. The rAF loop\n * runs while the pointer is inside, a wave is alive, or any dot is easing\n * back to rest. Returns a cleanup that detaches listeners and cancels it.\n */\nfunction attachPointerInteraction(\n\tcanvas: HTMLCanvasElement,\n\tctx: CanvasRenderingContext2D,\n\tglowCtx: CanvasRenderingContext2D,\n\tdots: Dot[],\n\tcssW: number,\n\tcssH: number,\n): () => void {\n\tlet pointerInside = false;\n\tlet pointerX = 0;\n\tlet pointerY = 0;\n\t// Smoothed ripple center trailing the raw pointer position.\n\tlet cursorX = 0;\n\tlet cursorY = 0;\n\tlet cursorAdopted = false;\n\tlet lastFrameAt = 0;\n\tconst waves: ClickWave[] = [];\n\tlet raf = 0;\n\n\tconst toCanvasPoint = (e: PointerEvent): { x: number; y: number } => {\n\t\tconst rect = canvas.getBoundingClientRect();\n\t\treturn { x: e.clientX - rect.left, y: e.clientY - rect.top };\n\t};\n\n\tconst frame = (now: number): void => {\n\t\tconst dt = lastFrameAt\n\t\t\t? Math.min((now - lastFrameAt) / 1000, 0.05)\n\t\t\t: 1 / 60;\n\t\tlastFrameAt = now;\n\n\t\t// Prune click waves whose front has crossed the whole canvas.\n\t\tconst waveLifetime = (cssW / CLICK_SPEED + CLICK_RISE + 0.25) * 1000;\n\t\tfor (let i = waves.length - 1; i >= 0; i--) {\n\t\t\tif (now - waves[i].start > waveLifetime) waves.splice(i, 1);\n\t\t}\n\n\t\tif (!cursorAdopted) {\n\t\t\tcursorX = pointerX;\n\t\t\tcursorY = pointerY;\n\t\t\tcursorAdopted = true;\n\t\t}\n\t\tconst follow = 1 - Math.exp(-dt / CURSOR_FOLLOW_TAU);\n\t\tcursorX += (pointerX - cursorX) * follow;\n\t\tcursorY += (pointerY - cursorY) * follow;\n\n\t\tconst ease = 1 - Math.exp(-dt / SWELL_TAU);\n\t\tlet settled = true;\n\t\tfor (const dot of dots) {\n\t\t\tif (\n\t\t\t\t!updateDot(dot, {\n\t\t\t\t\tnow,\n\t\t\t\t\tcssW,\n\t\t\t\t\tease,\n\t\t\t\t\tcursorX,\n\t\t\t\t\tcursorY,\n\t\t\t\t\tpointerInside,\n\t\t\t\t\twaves,\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\tsettled = false;\n\t\t\t}\n\t\t}\n\n\t\tctx.clearRect(0, 0, cssW, cssH);\n\t\tdrawDots(ctx, dots);\n\t\tglowCtx.clearRect(0, 0, cssW, cssH);\n\t\tdrawGlow(glowCtx, dots);\n\n\t\tconst active = waves.length > 0 || pointerInside || !settled;\n\t\traf = active ? requestAnimationFrame(frame) : 0;\n\t\tif (!raf) lastFrameAt = 0;\n\t};\n\n\tconst start = (): void => {\n\t\tif (raf) return;\n\t\traf = requestAnimationFrame(frame);\n\t};\n\n\tconst onEnter = (e: PointerEvent): void => {\n\t\tconst p = toCanvasPoint(e);\n\t\tpointerInside = true;\n\t\tpointerX = p.x;\n\t\tpointerY = p.y;\n\t\tstart();\n\t};\n\n\tconst onMove = (e: PointerEvent): void => {\n\t\tconst p = toCanvasPoint(e);\n\t\tpointerX = p.x;\n\t\tpointerY = p.y;\n\t\t// A pointermove on the canvas implies the pointer is over it: adopt\n\t\t// it unconditionally so a rebuild under a stationary pointer doesn't\n\t\t// leave the swell dead until a leave/re-enter cycle.\n\t\tpointerInside = true;\n\t\tstart();\n\t};\n\n\tconst onDown = (e: PointerEvent): void => {\n\t\tconst p = toCanvasPoint(e);\n\t\twaves.push({ x: p.x, y: p.y, start: performance.now() });\n\t\tstart();\n\t};\n\n\tconst onLeave = (): void => {\n\t\tpointerInside = false;\n\t\t// Draw one final frame at rest.\n\t\tstart();\n\t};\n\n\tcanvas.addEventListener(\"pointerenter\", onEnter);\n\tcanvas.addEventListener(\"pointermove\", onMove);\n\tcanvas.addEventListener(\"pointerdown\", onDown);\n\tcanvas.addEventListener(\"pointerleave\", onLeave);\n\tcanvas.addEventListener(\"pointercancel\", onLeave);\n\n\t// If the pointer is already over the canvas when the interaction\n\t// attaches, adopt it; the first pointermove corrects the ripple center.\n\tif (canvas.matches(\":hover\")) {\n\t\tpointerInside = true;\n\t\tpointerX = cssW / 2;\n\t\tpointerY = cssH / 2;\n\t\tstart();\n\t}\n\n\treturn () => {\n\t\tcanvas.removeEventListener(\"pointerenter\", onEnter);\n\t\tcanvas.removeEventListener(\"pointermove\", onMove);\n\t\tcanvas.removeEventListener(\"pointerdown\", onDown);\n\t\tcanvas.removeEventListener(\"pointerleave\", onLeave);\n\t\tcanvas.removeEventListener(\"pointercancel\", onLeave);\n\t\tif (raf) cancelAnimationFrame(raf);\n\t};\n}\n\nfunction usePrefersReducedMotion(): boolean {\n\tconst [reduced, setReduced] = React.useState(false);\n\tReact.useEffect(() => {\n\t\tconst mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n\t\tsetReduced(mq.matches);\n\t\tconst onChange = (e: MediaQueryListEvent) => setReduced(e.matches);\n\t\tmq.addEventListener(\"change\", onChange);\n\t\treturn () => mq.removeEventListener(\"change\", onChange);\n\t}, []);\n\treturn reduced;\n}\n\n/* -------------------------------------------------------------------------\n * FooterWordmark\n * ---------------------------------------------------------------------- */\n\nexport interface FooterWordmarkProps {\n\t/** The word to render as a halftone dot grid. */\n\ttext: string;\n\t/** Optional image mark composed at the same height, left of the text. */\n\tlogoSrc?: string;\n\t/** Reserved aspect ratio that prevents layout shift before first draw. */\n\taspectRatio?: string;\n\t/** Applied to the font probe: controls the family used for the raster. */\n\tfontClassName?: string;\n\tclassName?: string;\n}\n\n/**\n * Halftone wordmark: optional logo mark and display lettering composed at\n * equal height, rasterized offscreen and redrawn as a color-sampled dot grid\n * that fades toward the bottom. Dots swell around the pointer and a click\n * ripples across the lockup (static under reduced motion). Decorative and\n * DPR-crisp; designed to blend over a dark, glowing backdrop.\n */\nexport function FooterWordmark({\n\ttext,\n\tlogoSrc,\n\taspectRatio = \"23 / 4\",\n\tfontClassName = \"font-serif font-bold\",\n\tclassName,\n}: FooterWordmarkProps) {\n\tconst canvasRef = React.useRef<HTMLCanvasElement>(null);\n\tconst glowRef = React.useRef<HTMLCanvasElement>(null);\n\tconst probeRef = React.useRef<HTMLSpanElement>(null);\n\tconst shouldReduceMotion = usePrefersReducedMotion();\n\n\tReact.useEffect(() => {\n\t\tconst canvas = canvasRef.current;\n\t\tconst glowCanvas = glowRef.current;\n\t\tconst probe = probeRef.current;\n\t\tif (!canvas || !glowCanvas || !probe) return;\n\n\t\tlet cancelled = false;\n\t\tlet detachInteraction: (() => void) | null = null;\n\n\t\tconst build = async () => {\n\t\t\tdetachInteraction?.();\n\t\t\tdetachInteraction = null;\n\n\t\t\t// Hashed/next-font families resolve from a probe element.\n\t\t\tconst family = getComputedStyle(probe).fontFamily;\n\t\t\tconst [logo] = await Promise.all([\n\t\t\t\tlogoSrc ? loadImage(logoSrc).catch(() => null) : null,\n\t\t\t\tdocument.fonts.load(`700 100px ${family}`).catch(() => undefined),\n\t\t\t]);\n\t\t\tif (cancelled) return;\n\n\t\t\tconst cssW = canvas.clientWidth;\n\t\t\tif (!cssW) return;\n\t\t\tconst raster = rasterizeLockup(family, text, logo, cssW);\n\t\t\tif (!raster) return;\n\n\t\t\tconst cssH = raster.height;\n\t\t\t// Scale the grid with width so narrow renders keep the same fine\n\t\t\t// halftone texture as the full-width landing page instead of a\n\t\t\t// coarse blocky grid (aim for 20+ dot rows per letter).\n\t\t\tconst cell = Math.max(4, Math.min(9, cssW / 150));\n\t\t\tconst dpr = Math.min(window.devicePixelRatio || 1, 2.5);\n\t\t\tcanvas.width = Math.round(cssW * dpr);\n\t\t\tcanvas.height = Math.round(cssH * dpr);\n\t\t\tcanvas.style.height = `${cssH}px`;\n\t\t\tglowCanvas.width = canvas.width;\n\t\t\tglowCanvas.height = canvas.height;\n\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\tconst glowCtx = glowCanvas.getContext(\"2d\");\n\t\t\tif (!ctx || !glowCtx) return;\n\t\t\tctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n\t\t\tglowCtx.setTransform(dpr, 0, 0, dpr, 0, 0);\n\n\t\t\tconst dots = buildDots(raster, cssW, cssH, cell);\n\t\t\tdrawDots(ctx, dots);\n\t\t\tglowCtx.clearRect(0, 0, cssW, cssH);\n\t\t\tif (shouldReduceMotion) return;\n\n\t\t\tdetachInteraction = attachPointerInteraction(\n\t\t\t\tcanvas,\n\t\t\t\tctx,\n\t\t\t\tglowCtx,\n\t\t\t\tdots,\n\t\t\t\tcssW,\n\t\t\t\tcssH,\n\t\t\t);\n\t\t};\n\n\t\tbuild();\n\n\t\tlet timer: ReturnType<typeof setTimeout>;\n\t\tconst onResize = () => {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = setTimeout(build, 180);\n\t\t};\n\t\twindow.addEventListener(\"resize\", onResize);\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t\tdetachInteraction?.();\n\t\t\tclearTimeout(timer);\n\t\t\twindow.removeEventListener(\"resize\", onResize);\n\t\t};\n\t}, [text, logoSrc, shouldReduceMotion]);\n\n\treturn (\n\t\t<div className={className}>\n\t\t\t{/* Invisible probe that resolves the font family for the canvas. */}\n\t\t\t<span\n\t\t\t\tref={probeRef}\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={cn(\"absolute h-0 w-0 overflow-hidden\", fontClassName)}\n\t\t\t/>\n\t\t\t{/* Two stacked layers, because a canvas can only carry one blend\n\t\t\t    mode: the base halftone blends with the backdrop, and the click\n\t\t\t    ripple fades in an un-blended white copy of the same dots on\n\t\t\t    top. `relative` with NO z-index keeps both blending against the\n\t\t\t    footer background: a stacking context would isolate them. */}\n\t\t\t<div className=\"relative\" role=\"presentation\">\n\t\t\t\t<canvas\n\t\t\t\t\tref={canvasRef}\n\t\t\t\t\tclassName=\"block w-full mix-blend-overlay\"\n\t\t\t\t\tstyle={{ aspectRatio }}\n\t\t\t\t/>\n\t\t\t\t<canvas\n\t\t\t\t\tref={glowRef}\n\t\t\t\t\tclassName=\"pointer-events-none absolute inset-0 block h-full w-full\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/new-york/ui/grain-overlay.tsx",
      "content": "import { cn } from \"@/lib/utils\";\n\n/**\n * Fractal-noise tile rendered by the browser's own SVG filter, inlined as a\n * data URI so it costs no request and no decode. `stitchTiles` keeps the tile\n * seamless when it repeats, so the grain never shows a grid on large\n * surfaces. A single octave at a high base frequency reads as film grain;\n * `feColorMatrix` desaturates it so the speckle doesn't tint the backdrop.\n */\nconst GRAIN_TILE =\n\t\"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E\\\")\";\n\n/**\n * How the grain is composited:\n *\n * - `photo`: detailed, mostly dark artwork. Overlay blending degrades to\n *   multiply against dark pixels, so composite normally at low opacity.\n * - `surface`: smooth gradients and flat color. Overlay ties the speckle to\n *   the underlying hue, and a much lower opacity is enough.\n */\nconst VARIANT_CLASSES = {\n\tphoto: \"opacity-[0.24]\",\n\tsurface: \"opacity-[0.06] mix-blend-overlay\",\n} as const;\n\nexport interface GrainOverlayProps {\n\t/** Compositing mode: `photo` for imagery, `surface` for gradients. */\n\tvariant?: keyof typeof VARIANT_CLASSES;\n\t/** Match the parent's radius so the grain is clipped to the same shape. */\n\tclassName?: string;\n}\n\n/**\n * Film-grain layer for images and large gradient surfaces: breaks up\n * banding and gives flat artwork a tactile, printed feel. Absolutely\n * positioned, so the parent must be positioned and should clip\n * (`overflow-hidden` or a matching radius on this element).\n */\nexport function GrainOverlay({\n\tvariant = \"photo\",\n\tclassName,\n}: GrainOverlayProps) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t\"pointer-events-none absolute inset-0\",\n\t\t\t\tVARIANT_CLASSES[variant],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={{ backgroundImage: GRAIN_TILE }}\n\t\t/>\n\t);\n}\n",
      "type": "registry:ui"
    }
  ]
}