# Halftone hero

> A monumental 3D WebGL halftone-engraved hero framed by a dense 4-band hairline grid, optical clarity pointer lens, velocity-braking logo rail and interactive 3D capability switcher.

Most hero sections stack a pill badge over generic centered type and a static screenshot. Halftone hero pairs a live WebGL raymarched architectural monument — a fluted rotunda plinth, infinite perspective terrace field, beveled core and three notched orbital rings printed in real-time 8×8 Bayer halftone and copperplate micro-etching — with four tightly seated architectural hairline bands. Moving the pointer tilts the 3D camera via springs and opens an optical clarity aperture that refines print dots into specular marble; clicking sends a 3D radial shockwave across the terraces; switching any of the three bottom capability bays physically reconfigures the sculpture, morphs the top bar announcement and glides the active top hairline.

## Install

```bash
npx shadcn@latest add @hairline-pro/halftone-hero
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: `lucide-react`
- Hairline UI components it needs (the CLI installs them too): `text-morph`, `number-roll`
- Docs and live preview: https://hairlineui.com/blocks/halftone-hero
- Premium block, included with All-Access (https://hairlineui.com/buy/all-access?from=blocks). Installs only with an All-Access token through the @hairline-pro registry: https://hairlineui.com/ui/installation#premium. Its source isn't public.

## Usage

```tsx
import { HalftoneHero } from "@/components/halftone-hero";

<HalftoneHero
  brand="Kestrel"
  headline={["Command customers", "and revenue with", "precision"]}
  subheadline="Surface live buyer intent and lock accurate quarter forecasts automatically."
  primaryAction={{ label: "Start using Kestrel", href: "/signup" }}
  secondaryAction={{ label: "Watch product tour", href: "/demo" }}
/>
```

## Full-width hero at the top of a landing page

Drop HalftoneHero inside a max-width page wrapper or full-bleed container. Swap `tone="obsidian"` and any `accent` token to re-skin the entire 3D engraving shader to your brand.

```tsx
import { HalftoneHero } from "@/components/halftone-hero";

export function LandingHero() {
  return (
    <div className="mx-auto max-w-[1360px] p-3 sm:p-4">
      <HalftoneHero
        brand="Kestrel"
        tone="cobalt"
        accent="var(--primary)"
        navLinks={[
          { label: "Products", href: "#products" },
          { label: "Solutions", href: "#solutions" },
          { label: "Pricing", href: "#pricing" },
          { label: "Customers", href: "#customers" },
        ]}
        navSecondaryAction={{ label: "Start free", href: "/signup" }}
        navPrimaryAction={{ label: "Book a demo", href: "/demo" }}
        headline={["Command customers", "and revenue with", "precision"]}
        subheadline="Surface live buyer intent, lock accurate quarter forecasts and write clean CRM updates automatically."
        primaryAction={{ label: "Start using Kestrel", href: "/signup" }}
        secondaryAction={{ label: "Watch product tour", href: "/demo" }}
      />
    </div>
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `brand` | `string` | – | Brand name rendered in the top-left architectural lockup. |
| `logo` | `ReactNode` | – | Optional custom geometric mark beside the brand name. |
| `navLinks` | `{ label: string; href: string }[]` | – | Primary top-bar navigation items with gliding hover highlight. |
| `navSecondaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | Compact white paper CTA in the top-right navbar bay. |
| `navPrimaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | Compact dark-ink CTA in the top-right navbar bay. |
| `headline` | `string[]` | – | Two to three crisp display lines revealed from masked slots on arrival. |
| `subheadline` | `string` | – | Concise supporting sentence beneath the display headline. |
| `primaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | Primary high-contrast letterpress CTA button. |
| `secondaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | Secondary dark-ink CTA with diagonal sweep hover. |
| `proof` | `{ count: number; label: string; avatars?: { initials: string; tint?: string }[] }` | – | Customer count rolled via NumberRoll beside spring-fanning avatars. |
| `logos` | `{ name: string; mark?: ReactNode }[]` | – | Partner marks scrolling in the velocity-braking WAAPI rail ticker. |
| `pillars` | `HalftoneHeroPillar[]` | – | Three interactive capability bays seated on the bottom hairline; each morphs the 3D sculpture. |
| `tone` | `"cobalt" \| "obsidian"` | `"cobalt"` | Switches the engraving ground between electric cobalt and deep matte obsidian. |
| `accent` | `string` | `"var(--primary)"` | Any CSS color or theme token driving the WebGL engraving hue. |

## States

- **arrival**: The 3D engraving sweeps across from left to right via spring while headline lines rise cleanly from masked slots staggered by 75ms.
- **pointer lens**: Mouse movement steers spring-damped camera parallax and opens a circular clarity aperture refining coarse halftone into illuminated marble.
- **shockwave**: Clicking open stage space launches a radial 3D wave that lifts the terraced columns and flashes white ink along the crest.
- **pillar morph**: Clicking or arrow-keying the three bottom capability bays glides the top hairline indicator, morphs the announcement via TextMorph and reconfigures the 3D sculpture.
- **logo brake**: Hovering the partner ticker eases playbackRate to 0 over 560ms via WAAPI, brightening the hovered mark while siblings dim.
- **reduced motion**: Renders one crisp finished WebGL frame, disables springs and ticker travel, and switches pillars instantaneously.

## What it handles

Shipping an editorial WebGL hero usually means pulling a 600KB 3D runtime, hand-building responsive nav drawers, logo tickers and interactive tab bars separately, and fighting text legibility over busy shaders.

- **Zero-dependency WebGL raymarcher**: Renders a 3D fluted rotunda, perspective terrace field and orbiting notched rings in one compact WebGL 1 fragment shader.
- **Live 8×8 Bayer + copperplate engraving**: Branchless ordered dithering and directional etching lines turn 3D shading into crisp printmaking in any brand hue.
- **Optical pointer clarity lens**: Moving the pointer tilts the 3D sculpture via springs and refines halftone dots beneath the cursor into smooth specular marble.
- **3D shockwaves and pillar morphing**: Clicking the stage ripples the perspective terraces; switching the three seated capability bays physically transforms the rings and core.
- **Dense seated hairline chrome**: Gliding nav hover indicator, kinetic vertical letterpress buttons, fanning avatar proof with NumberRoll and a WAAPI braking logo rail.
- **Off-screen sleep and reduced motion**: Pauses rendering automatically when scrolled out of view or hidden; shows one finished still frame under prefers-reduced-motion.

## Replaces

Three.js hero runtime, marketing navbar + drawer, velocity-braking logo ticker, interactive capability bar

## Where it fits

- **B2B SaaS and revenue platforms**: High-conviction editorial first screen with live proof, logo ticker and interactive capability tabs.
- **Fintech and treasury products**: Monumental architectural authority in cobalt or obsidian engraving with rolling numeric proof.
- **AI and developer infrastructure**: Interactive 3D WebGL visual engine with zero heavy Three.js bundle overhead.
- **Flagship product launches**: A full-bleed framed hero where every hover, click and tab click answers immediately.

## Notes

- Pure WebGL 1 fragment raymarcher with zero external 3D runtime dependencies; internal resolution caps at 1.35× DPR for crisp 2px halftone dots and smooth 60fps on phones.
- The WebGL canvas is hidden from screen readers (`aria-hidden`); all navigation, CTAs and capability tabs use native landmarks, `role="tablist"` and full arrow-key support.
- Automatically suspends `requestAnimationFrame` when off screen (`IntersectionObserver`) or in a background tab (`visibilitychange`).
- Honors `prefers-reduced-motion: reduce` by rendering one finished frame and disabling ticker travel and spring animations.

License: Hairline UI commercial license, not MIT (https://hairlineui.com/license#blocks)
