{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swarm-about",
  "type": "registry:block",
  "title": "Swarm About",
  "description": "About Section built with Swarm (particle text animation): three chapters, each filling more of the mark with dots. A take on the particle effect (particles) and text animation (text effect). An about section that tells the company's story in three chapters. The mark on the right is the company today, drawn as hollow rings; each chapter fills in as much of it as existed then, so stepping from twelve GPUs in a lab to one global endpoint brings the solid dots in from the edge.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "about-sections",
    "about",
    "particle-effect",
    "text-animation"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/about-sections/swarm-about",
  "registryDependencies": [
    "https://keyframeui.com/r/swarm.json"
  ],
  "files": [
    {
      "path": "components/swarm-about.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 section yours: the\n * heading, the chapters of your story and the facts under it.\n * The mark on the right is the company today; each chapter's\n * `fill` is how much of it existed then, so stepping through\n * the story fills it in, dot by dot, from the edge.\n * ─────────────────────────────────────────────────────────── */\n\n/** The brand color: the eyebrow and the square marks on the stage. Light and dark. */\nconst ACCENT = { light: \"#d93f06\", dark: \"#ff7a45\" };\n/** The part of the mark that didn't exist yet: quiet gray rings. */\nconst RINGS = \"text-zinc-300 dark:text-zinc-700\";\n\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(\"\");\n\nconst EYEBROW = \"About Covey\";\nconst HEADING = \"Built from spare parts.\";\nconst LEAD =\n  \"Covey started as a way to borrow the lab's GPUs at night. It grew one idle card at a time, and it still does.\";\n\nconst CHAPTERS = [\n  {\n    year: \"2023\",\n    title: \"Twelve cards in a lab\",\n    body: \"Two grad students wired their department's idle GPUs to one queue so their models could train overnight.\",\n    fill: 0.04,\n    figure: \"12 GPUs\",\n    /** The chapter's dots blend `from` → `to`; `year` is its year's color, dark enough to read at 12px. */\n    tones: { from: \"text-[#00b25d] dark:text-[#34d399]\", to: \"text-[#00a3ff] dark:text-[#38bdf8]\", year: \"text-[#008a48] dark:text-[#34d399]\" },\n  },\n  {\n    year: \"2024\",\n    title: \"A network, by accident\",\n    body: \"Other labs asked to plug in. By December, 4,000 GPUs in 38 cities were answering each other's requests.\",\n    fill: 0.38,\n    figure: \"4,096 GPUs\",\n    tones: { from: \"text-[#7c3aed] dark:text-[#a78bfa]\", to: \"text-[#ff2d87] dark:text-[#ff5ca8]\", year: \"text-[#7c3aed] dark:text-[#a78bfa]\" },\n  },\n  {\n    year: \"2026\",\n    title: \"One endpoint\",\n    body: \"Today 41,207 GPUs answer as one, and a few more come online every hour. Most of them would otherwise sit dark.\",\n    fill: 0.93,\n    figure: \"41,207 GPUs\",\n    tones: { from: \"text-[#ff5a1f] dark:text-[#ff7a45]\", to: \"text-[#ff2d87] dark:text-[#ff5ca8]\", year: \"text-[#d93f06] dark:text-[#ff7a45]\" },\n  },\n];\n\nconst FACTS = [\n  { label: \"Founded\", value: \"Zurich, 2023\" },\n  { label: \"Team\", value: \"23 people\" },\n  { label: \"Cities\", value: \"212\" },\n];\n\n/** Seconds a chapter stays before the story moves on by itself, until the visitor picks one. */\nconst CHAPTER_HOLD = 3.2;\n\n/* ── Section ─────────────────────────────────────────────── */\n\nexport function SwarmAbout() {\n  const [index, setIndex] = React.useState(0);\n  const [picked, setPicked] = React.useState(false);\n  const timer = React.useRef(0);\n  const chapter = CHAPTERS[index];\n  React.useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  // Once a chapter's dots have landed, hold it, then turn to the next, stopping on today.\n  const onSettle = React.useCallback(() => {\n    window.clearTimeout(timer.current);\n    if (picked || index === CHAPTERS.length - 1) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    timer.current = window.setTimeout(() => setIndex((i) => Math.min(i + 1, CHAPTERS.length - 1)), CHAPTER_HOLD * 1000);\n  }, [picked, index]);\n\n  const pick = (i: number) => {\n    window.clearTimeout(timer.current);\n    setPicked(true);\n    setIndex(i);\n  };\n\n  return (\n    <section\n      style={{ \"--accent\": ACCENT.light, \"--accent-dark\": ACCENT.dark } as React.CSSProperties}\n      className=\"bg-white text-zinc-950 dark:bg-[#09090b] dark:text-white\"\n    >\n      {/* On a phone the mark sits between the intro and the chapters, so a tapped chapter fills it in view. */}\n      <div className=\"mx-auto grid max-w-6xl grid-cols-1 gap-x-16 gap-y-10 px-6 py-20 sm:py-24 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] lg:grid-rows-[auto_1fr] lg:gap-y-0\">\n        <div className=\"min-w-0 lg:col-start-1 lg:row-start-1\">\n          <p className=\"font-mono text-[11px] tracking-wide text-(--accent) uppercase dark:text-(--accent-dark)\">{EYEBROW}</p>\n          <h2 className=\"mt-4 text-4xl leading-[1.05] font-semibold tracking-[-0.035em] text-balance sm:text-5xl\">{HEADING}</h2>\n          <p className=\"mt-5 max-w-md text-base leading-relaxed text-zinc-600 dark:text-zinc-400\">{LEAD}</p>\n        </div>\n\n        <figure className=\"relative mx-auto w-full max-w-[32rem] lg:col-start-2 lg:row-span-2 lg:row-start-1 lg:self-center\">\n          <Swarm\n            path={MARK}\n            fill={chapter.fill}\n            dotSize={5.5}\n            gap={1.5}\n            label={`Covey in ${chapter.year}: ${chapter.figure}`}\n            onSettle={onSettle}\n            dotClassName={chapter.tones.from}\n            gradientClassName={chapter.tones.to}\n            ringClassName={RINGS}\n            className=\"aspect-square border border-zinc-950/10 bg-[#f4f4f5] dark:border-white/10 dark:bg-white/[0.03]\"\n          >\n            <span aria-hidden className=\"absolute top-[8%] right-[9%] size-2.5 bg-(--accent) dark:bg-(--accent-dark)\" />\n            <span aria-hidden className=\"absolute bottom-[10%] left-[8%] 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>Covey, {chapter.year}</span>\n            <span aria-live=\"polite\" className=\"text-zinc-800 tabular-nums dark:text-zinc-200\">\n              {chapter.figure}\n            </span>\n          </figcaption>\n        </figure>\n\n        <div className=\"min-w-0 lg:col-start-1 lg:row-start-2\">\n          <ol className=\"border-t lg:mt-10 border-zinc-950/10 dark:border-white/10\">\n            {CHAPTERS.map((c, i) => {\n              const on = i === index;\n              return (\n                <li key={c.year} className=\"border-b border-zinc-950/10 dark:border-white/10\">\n                  <button\n                    type=\"button\"\n                    aria-current={on ? \"step\" : undefined}\n                    onClick={() => pick(i)}\n                    className=\"group grid w-full grid-cols-[3.5rem_minmax(0,1fr)] gap-x-4 rounded-sm py-4 text-left focus-visible:bg-zinc-950/[0.03] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-zinc-950 dark:focus-visible:bg-white/[0.04] dark:focus-visible:outline-white\"\n                  >\n                    <span\n                      className={`font-mono text-xs tabular-nums transition-colors duration-200 ${on ? c.tones.year : \"text-zinc-500 group-hover:text-zinc-700 dark:text-zinc-400 dark:group-hover:text-zinc-200\"}`}\n                    >\n                      {c.year}\n                    </span>\n                    <span className=\"min-w-0\">\n                      <span\n                        className={`block text-[15px] font-medium tracking-tight transition-colors duration-200 ${on ? \"\" : \"text-zinc-500 group-hover:text-zinc-800 dark:text-zinc-400 dark:group-hover:text-zinc-200\"}`}\n                      >\n                        {c.title}\n                      </span>\n                      {/* The open chapter's story; the grid row folds the others to nothing. */}\n                      <span\n                        className={`grid transition-[grid-template-rows,opacity] duration-300 ease-out ${on ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\"}`}\n                      >\n                        <span className=\"overflow-hidden\">\n                          <span className=\"block pt-1.5 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400\">{c.body}</span>\n                        </span>\n                      </span>\n                    </span>\n                  </button>\n                </li>\n              );\n            })}\n          </ol>\n\n          <dl className=\"mt-8 grid grid-cols-3 gap-4\">\n            {FACTS.map((f) => (\n              <div key={f.label}>\n                <dt className=\"font-mono text-[11px] tracking-wide text-zinc-500 uppercase dark:text-zinc-400\">{f.label}</dt>\n                <dd className=\"mt-1 text-[15px] font-medium tracking-tight\">{f.value}</dd>\n              </div>\n            ))}\n          </dl>\n        </div>\n\n      </div>\n    </section>\n  );\n}\n\n/** A circle as path data, so the mark stays one `d` string. */\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"
    }
  ]
}