{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swarm-hero",
  "type": "registry:block",
  "title": "Swarm Hero",
  "description": "Hero Section built with Swarm (particle text animation): dots stream into the mark and spell each stat on hover. A take on the particle effect (particles) and text animation (text effect). A hero for a GPU network: the headline and two calls to action on the left, and on the right a square stage where dots gather on the frame, fly in on hairline trails and pack into the brand's mark. Point at one of the three numbers under the headline and the same dots rearrange to spell it; leave and they go back to the mark.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "hero-sections",
    "hero",
    "particle-effect",
    "text-animation"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/hero-sections/swarm-hero",
  "registryDependencies": [
    "https://keyframeui.com/r/swarm.json"
  ],
  "files": [
    {
      "path": "components/swarm-hero.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Swarm } from \"@/components/ui/swarm\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the hero yours: the nav, the\n * headline, the two calls to action and the three numbers.\n * The stage sets your mark in dots; pointing at a number (or\n * focusing it) sets that number in the same dots instead.\n * ─────────────────────────────────────────────────────────── */\n\n/** The brand's two colors: the logo, the mark's dots blend from one to the other. Light and dark. */\nconst ACCENT = { light: \"#ff5a1f\", dark: \"#ff7a45\" };\nconst ACCENT_TO = { light: \"#ff2d87\", dark: \"#ff5ca8\" };\n/** The mark's dots, as the `text-*` classes the stage reads. */\nconst MARK_TONES = { from: \"text-[#ff5a1f] dark:text-[#ff7a45]\", to: \"text-[#ff2d87] dark:text-[#ff5ca8]\" };\n\nconst BRAND = { name: \"Covey\", href: \"#\" };\n/** Covey's mark: three discs and a smaller one joining them, drawn in a 24 × 24 box. */\nconst MARK = [disc(6.5, 17.5, 4.5), disc(17.5, 17.5, 4.5), disc(6.5, 6.5, 4.5), disc(18.5, 5.5, 3)].join(\"\");\nconst NAV_LINKS = [\n  { label: \"Network\", href: \"#network\" },\n  { label: \"Pricing\", href: \"#pricing\" },\n  { label: \"Docs\", href: \"#docs\" },\n  { label: \"Changelog\", href: \"#changelog\" },\n];\nconst SIGN_IN = { label: \"Sign in\", href: \"#sign-in\" };\nconst NAV_CTA = { label: \"Start building\", href: \"#start\" };\n\nconst HEADLINE = \"Every idle GPU, answering as one.\";\nconst SUBLINE =\n  \"Covey pools spare GPUs from labs and data centers into a single inference endpoint. You send one request; the nearest free card answers it.\";\nconst PRIMARY = { label: \"Start building\", href: \"#start\" };\nconst SECONDARY = { label: \"Pool your GPUs\", href: \"#pool\" };\n\n/**\n * The numbers under the headline. `dots` is what the stage spells while one is pointed at, in the\n * number's own two colors; `label` is its label color, dark enough to read at 11px.\n */\nconst STATS = [\n  {\n    id: \"gpus\",\n    label: \"GPUs online\",\n    value: \"41,207\",\n    dots: \"41k\",\n    tones: { from: \"text-[#00b25d] dark:text-[#34d399]\", to: \"text-[#00a3ff] dark:text-[#38bdf8]\", label: \"text-[#008a48] dark:text-[#34d399]\" },\n  },\n  {\n    id: \"latency\",\n    label: \"P50 latency\",\n    value: \"38 ms\",\n    dots: \"38ms\",\n    tones: { from: \"text-[#7c3aed] dark:text-[#a78bfa]\", to: \"text-[#00a3ff] dark:text-[#38bdf8]\", label: \"text-[#7c3aed] dark:text-[#a78bfa]\" },\n  },\n  {\n    id: \"price\",\n    label: \"Per 1M tokens\",\n    value: \"$0.18\",\n    dots: \"$0.18\",\n    tones: { from: \"text-[#f59e0b] dark:text-[#fbbf24]\", to: \"text-[#ff2d87] dark:text-[#ff5ca8]\", label: \"text-[#b45309] dark:text-[#fbbf24]\" },\n  },\n];\n\nconst FIGURE = { caption: \"Fig. 01 — The Covey network\", status: \"Live\" };\n\n/** Milliseconds a pointer rests on a number before the stage spells it, and lingers after it leaves. */\nconst INTENT = { enter: 120, leave: 260 };\n\n/* ── Section ─────────────────────────────────────────────── */\n\nexport function SwarmHero() {\n  const [active, setActive] = React.useState<string | null>(null);\n  const timer = React.useRef(0);\n  React.useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  const show = (id: string | null, wait: number) => {\n    window.clearTimeout(timer.current);\n    timer.current = window.setTimeout(() => setActive(id), wait);\n  };\n  const stat = STATS.find((s) => s.id === active);\n  const tones = stat?.tones ?? MARK_TONES;\n  const logoId = React.useId();\n\n  return (\n    <section\n      style={\n        { \"--accent\": ACCENT.light, \"--accent-dark\": ACCENT.dark, \"--accent-to\": ACCENT_TO.light, \"--accent-to-dark\": ACCENT_TO.dark } as React.CSSProperties\n      }\n      className=\"relative overflow-x-clip bg-white text-zinc-950 dark:bg-[#09090b] dark:text-white\"\n    >\n      <header className=\"mx-auto flex h-16 max-w-6xl items-center justify-between gap-6 px-6\">\n        <a\n          href={BRAND.href}\n          className=\"flex items-center gap-2 rounded-sm text-[15px] font-semibold tracking-tight focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-zinc-950 dark:focus-visible:outline-white\"\n        >\n          <svg viewBox=\"0 0 24 24\" aria-hidden className=\"size-5\">\n            <defs>\n              <linearGradient id={logoId} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n                <stop offset=\"0\" className=\"[stop-color:var(--accent)] dark:[stop-color:var(--accent-dark)]\" />\n                <stop offset=\"1\" className=\"[stop-color:var(--accent-to)] dark:[stop-color:var(--accent-to-dark)]\" />\n              </linearGradient>\n            </defs>\n            <path d={MARK} fill={`url(#${logoId})`} />\n          </svg>\n          {BRAND.name}\n        </a>\n        <nav aria-label=\"Main\" className=\"hidden items-center gap-7 text-sm text-zinc-600 md:flex dark:text-zinc-400\">\n          {NAV_LINKS.map((link) => (\n            <a\n              key={link.label}\n              href={link.href}\n              className=\"rounded-sm transition-colors duration-150 hover:text-zinc-950 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-zinc-950 dark:hover:text-white dark:focus-visible:outline-white\"\n            >\n              {link.label}\n            </a>\n          ))}\n        </nav>\n        <div className=\"flex items-center gap-1\">\n          <a\n            href={SIGN_IN.href}\n            className=\"hidden rounded-sm px-3 py-2 font-mono text-xs text-zinc-600 transition-colors duration-150 hover:text-zinc-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 sm:block dark:text-zinc-400 dark:hover:text-white dark:focus-visible:outline-white\"\n          >\n            [ {SIGN_IN.label} ]\n          </a>\n          <a\n            href={NAV_CTA.href}\n            className=\"rounded-full bg-zinc-950 px-4 py-2 text-sm font-medium text-white transition-colors duration-150 hover:bg-zinc-800 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200 dark:focus-visible:outline-white\"\n          >\n            {NAV_CTA.label}\n          </a>\n        </div>\n      </header>\n\n      <div className=\"mx-auto grid max-w-6xl grid-cols-1 items-center gap-x-14 gap-y-10 px-6 pt-8 pb-16 sm:pt-12 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)] lg:pt-10 lg:pb-20\">\n        <div className=\"min-w-0\">\n          <h1 className=\"max-w-xl text-[2.6rem] leading-[1.04] font-semibold tracking-[-0.04em] text-balance sm:text-6xl lg:text-[4rem]\">\n            {HEADLINE}\n          </h1>\n          <p className=\"mt-6 max-w-md text-base leading-relaxed text-zinc-600 sm:text-[17px] dark:text-zinc-400\">{SUBLINE}</p>\n          <div className=\"mt-8 flex flex-wrap items-center gap-3\">\n            <a\n              href={PRIMARY.href}\n              className=\"rounded-full bg-zinc-950 px-5 py-3 text-sm font-medium text-white transition-colors duration-150 hover:bg-zinc-800 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200 dark:focus-visible:outline-white\"\n            >\n              {PRIMARY.label}\n            </a>\n            <a\n              href={SECONDARY.href}\n              className=\"group rounded-sm px-3 py-3 font-mono text-[13px] whitespace-nowrap text-zinc-700 transition-colors duration-150 hover:text-zinc-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:text-zinc-300 dark:hover:text-white dark:focus-visible:outline-white\"\n            >\n              <span aria-hidden>[</span>\n              {/* The space after the bracket holds a status dot that lights on hover, the way a node lights when it joins. */}\n              <span aria-hidden className=\"relative inline-block w-[1ch] align-middle\">\n                <span className=\"absolute top-1/2 left-1/2 size-1.5 -translate-1/2 rounded-full bg-(--accent) opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 dark:bg-(--accent-dark)\" />\n              </span>\n              {SECONDARY.label}\n              <span aria-hidden> ]</span>\n            </a>\n          </div>\n\n          <dl className=\"mt-12 grid max-w-lg grid-cols-3 gap-x-7 gap-y-4 border-t border-zinc-950/10 pt-5 dark:border-white/10\">\n            {STATS.map((s) => (\n              <div\n                key={s.id}\n                tabIndex={0}\n                onPointerEnter={(e) => e.pointerType === \"mouse\" && show(s.id, INTENT.enter)}\n                onPointerLeave={(e) => e.pointerType === \"mouse\" && show(null, INTENT.leave)}\n                onClick={() => show(active === s.id ? null : s.id, 0)}\n                onFocus={() => show(s.id, 0)}\n                onBlur={() => show(null, INTENT.leave)}\n                className=\"-m-2 cursor-default rounded-md p-2 transition-colors duration-150 outline-none hover:bg-zinc-950/[0.03] focus-visible:ring-2 focus-visible:ring-zinc-950 dark:hover:bg-white/[0.04] dark:focus-visible:ring-white\"\n              >\n                <dt className={`font-mono text-[11px] tracking-wide uppercase ${s.tones.label}`}>{s.label}</dt>\n                <dd className=\"mt-1.5 text-xl font-semibold tracking-tight tabular-nums sm:text-2xl\">{s.value}</dd>\n              </div>\n            ))}\n          </dl>\n        </div>\n\n        <figure className=\"relative w-full max-w-[34rem] lg:max-w-none\">\n          <Swarm\n            text={stat?.dots}\n            path={MARK}\n            label={stat ? `${stat.label}: ${stat.value}` : `${BRAND.name} mark`}\n            dotSize={6}\n            gap={1.5}\n            dotClassName={tones.from}\n            gradientClassName={tones.to}\n            className=\"aspect-square border border-zinc-950/10 bg-[#f4f4f5] dark:border-white/10 dark:bg-white/[0.03]\"\n          >\n            {/* Registration marks, solid and outlined, set off the grid like a proof sheet. */}\n            <span aria-hidden className=\"absolute top-[7%] left-[7%] size-2.5 bg-(--accent) dark:bg-(--accent-dark)\" />\n            <span aria-hidden className=\"absolute top-[11%] right-[12%] size-2.5 border border-zinc-400 dark:border-zinc-600\" />\n            <span aria-hidden className=\"absolute right-[5%] bottom-[38%] size-2.5 bg-(--accent-to) dark:bg-(--accent-to-dark)\" />\n            <span aria-hidden className=\"absolute bottom-[9%] left-[16%] size-2.5 border border-zinc-400 dark:border-zinc-600\" />\n          </Swarm>\n          <figcaption className=\"flex items-center justify-between gap-4 border-x border-b border-zinc-950/10 px-4 py-3 font-mono text-[11px] tracking-wide text-zinc-500 uppercase dark:border-white/10 dark:text-zinc-400\">\n            <span>{FIGURE.caption}</span>\n            <span className=\"flex items-center gap-2 text-zinc-700 dark:text-zinc-300\">\n              <span aria-hidden className=\"size-1.5 rounded-full bg-(--accent) dark:bg-(--accent-dark)\" />\n              {FIGURE.status}\n            </span>\n          </figcaption>\n        </figure>\n      </div>\n    </section>\n  );\n}\n\n/** A circle as path data, so the mark stays one `d` string the stage and the logo share. */\nfunction disc(cx: number, cy: number, r: number) {\n  return `M${cx} ${cy - r}A${r} ${r} 0 1 1 ${cx} ${cy + r}A${r} ${r} 0 1 1 ${cx} ${cy - r}Z`;\n}\n"
    }
  ]
}