{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "jot-hero",
  "type": "registry:block",
  "title": "Jot Hero",
  "description": "Hero Section built with Jot (hand-drawn annotation arrow): handwritten notes guide a live demo. A take on the annotation (arrow). A split hero for a sync engine with a live demo beside the headline: a laptop and a phone on one checklist. A handwritten note asks the visitor to tick something off on the phone, then swings its arrow to the laptop, where the same row just ticked itself and flashed. Another note points at the one-line install command.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "hero-sections",
    "hero",
    "annotation"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/hero-sections/jot-hero",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://keyframeui.com/r/jot.json"
  ],
  "files": [
    {
      "path": "components/jot-hero.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\n\nimport { Jot } from \"@/components/ui/jot\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the hero yours: the nav, the\n * copy, the install command, the list both devices share and\n * the handwritten notes. The note over the devices asks the\n * visitor to tick something off on the phone, then swings its\n * arrow to the laptop, where the same row just ticked itself.\n * ─────────────────────────────────────────────────────────── */\n\n/** The one accent: the primary button, the checkmarks and the sync flash. */\nconst ACCENT = { light: \"#0f766e\", dark: \"#2dd4bf\" };\n\nconst BRAND = { name: \"Shoal\", href: \"#\" };\nconst NAV_LINKS = [\n  { label: \"Docs\", href: \"#docs\" },\n  { label: \"Customers\", href: \"#customers\" },\n  { label: \"Pricing\", href: \"#pricing\" },\n  { label: \"Changelog\", href: \"#changelog\" },\n];\nconst SIGN_IN = { label: \"Sign in\", href: \"#sign-in\" };\n\nconst ANNOUNCEMENT = { tag: \"New\", text: \"Offline mode for React Native\", href: \"#changelog\" };\nconst HEADLINE = \"Your app, in sync\";\nconst HEADLINE_QUIET = \"on every device.\";\nconst SUBLINE =\n  \"Shoal is the sync engine for apps people keep open all day. Writes land offline, merge without conflicts and reach every other device in about 40 ms.\";\nconst PRIMARY_CTA = { label: \"Start building\", href: \"#start\" };\nconst INSTALL = \"npm i @shoal/react\";\nconst FOOTNOTE = \"Free up to 1,000 devices. No card needed.\";\n\nconst NOTES = {\n  install: \"one line, really\",\n  tryIt: \"tick one off here\",\n  /** Once something's ticked, keyed by the device it landed on. */\n  synced: { laptop: \"and it's on the laptop already\", phone: \"and it's on the phone already\" },\n};\n\nconst LIST_TITLE = \"Launch checklist\";\nconst TASKS = [\n  { id: \"changelog\", label: \"Write the changelog\", done: true },\n  { id: \"video\", label: \"Record the demo video\", done: false },\n  { id: \"beta\", label: \"Email the beta list\", done: false },\n  { id: \"ship\", label: \"Ship v3.2\", done: false },\n];\n/** Round trips shown under each device as the visitor ticks things off. */\nconst LATENCIES = [38, 41, 33, 44, 36, 39];\n\n/* ── Section ─────────────────────────────────────────────── */\n\ntype Device = \"phone\" | \"laptop\";\n\nexport function JotHero() {\n  const [done, setDone] = React.useState(() => new Set(TASKS.filter((task) => task.done).map((task) => task.id)));\n  const [last, setLast] = React.useState<{ id: string; from: Device; n: number } | null>(null);\n  const [copied, setCopied] = React.useState(false);\n  const installRef = React.useRef<HTMLButtonElement>(null);\n\n  const toggle = (id: string, from: Device) => {\n    setDone((current) => {\n      const next = new Set(current);\n      if (next.has(id)) next.delete(id);\n      else next.add(id);\n      return next;\n    });\n    setLast((current) => ({ id, from, n: (current?.n ?? 0) + 1 }));\n  };\n\n  const copy = () => {\n    navigator.clipboard?.writeText(INSTALL).then(\n      () => {\n        setCopied(true);\n        window.setTimeout(() => setCopied(false), 1500);\n      },\n      () => {},\n    );\n  };\n\n  // Before anything is ticked, the note points at the phone's first open row; after, at the\n  // laptop's copy of whatever the visitor just changed.\n  const firstOpen = TASKS.find((task) => !done.has(task.id))?.id ?? TASKS[0].id;\n  const noteTarget = last\n    ? `[data-row=\"${last.from === \"phone\" ? \"laptop\" : \"phone\"}-${last.id}\"]`\n    : `[data-row=\"phone-${firstOpen}\"]`;\n  const latency = LATENCIES[(last?.n ?? 0) % LATENCIES.length];\n\n  return (\n    <section\n      data-jot-scope\n      style={{ \"--accent-light\": ACCENT.light, \"--accent-dark\": ACCENT.dark } as React.CSSProperties}\n      className=\"relative overflow-hidden bg-white text-zinc-950 [--accent:var(--accent-light)] dark:bg-zinc-950 dark:text-white dark:[--accent:var(--accent-dark)]\"\n    >\n      <header className=\"mx-auto flex h-16 max-w-6xl items-center justify-between px-6\">\n        <a href={BRAND.href} className=\"flex items-center gap-2 rounded-md text-[15px] font-semibold tracking-tight focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--accent)\">\n          <ShoalMark className=\"size-6 text-(--accent)\" />\n          {BRAND.name}\n        </a>\n        <nav className=\"hidden items-center gap-7 text-sm text-zinc-600 md:flex dark:text-zinc-400\">\n          {NAV_LINKS.map((link) => (\n            <a key={link.label} href={link.href} className=\"rounded-sm hover:text-zinc-950 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--accent) dark:hover:text-white\">\n              {link.label}\n            </a>\n          ))}\n        </nav>\n        <a href={SIGN_IN.href} className=\"rounded-full px-3.5 py-1.5 text-sm font-medium ring-1 ring-zinc-950/10 hover:bg-zinc-950/[0.03] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent) dark:ring-white/15 dark:hover:bg-white/[0.05]\">\n          {SIGN_IN.label}\n        </a>\n      </header>\n\n      <div className=\"mx-auto grid max-w-6xl items-center gap-x-10 gap-y-16 px-6 pt-12 pb-24 sm:pt-16 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)] lg:pt-20\">\n        <div>\n          <a\n            href={ANNOUNCEMENT.href}\n            className=\"inline-flex items-center gap-2 rounded-full bg-zinc-950/[0.04] py-1 pr-3 pl-1 text-xs font-medium text-zinc-700 ring-1 ring-zinc-950/[0.06] hover:bg-zinc-950/[0.06] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent) dark:bg-white/[0.06] dark:text-zinc-300 dark:ring-white/10\"\n          >\n            <span className=\"rounded-full bg-(--accent) px-2 py-0.5 text-white dark:text-zinc-950\">{ANNOUNCEMENT.tag}</span>\n            {ANNOUNCEMENT.text}\n            <span aria-hidden>→</span>\n          </a>\n          <h1 className=\"mt-6 text-4xl font-semibold tracking-[-0.035em] text-balance sm:text-6xl\">\n            {HEADLINE} <span className=\"text-zinc-400 dark:text-zinc-500\">{HEADLINE_QUIET}</span>\n          </h1>\n          <p className=\"mt-6 max-w-lg text-base leading-relaxed text-pretty text-zinc-600 sm:text-lg dark:text-zinc-400\">\n            {SUBLINE}\n          </p>\n\n          <div className=\"mt-9 flex flex-wrap items-center gap-3\">\n            <a\n              href={PRIMARY_CTA.href}\n              className=\"rounded-full bg-(--accent) px-5 py-2.5 text-sm font-semibold text-white transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent) dark:text-zinc-950\"\n            >\n              {PRIMARY_CTA.label}\n            </a>\n            <div className=\"relative\">\n              <button\n                ref={installRef}\n                type=\"button\"\n                onClick={copy}\n                className=\"group flex items-center gap-3 rounded-full bg-zinc-950/[0.04] py-2.5 pr-3 pl-4 font-mono text-[13px] ring-1 ring-zinc-950/[0.08] hover:bg-zinc-950/[0.06] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent) dark:bg-white/[0.05] dark:ring-white/10 dark:hover:bg-white/[0.08]\"\n              >\n                <span>\n                  <span className=\"text-zinc-400 select-none\">$ </span>\n                  {INSTALL}\n                </span>\n                <span className=\"text-zinc-400 group-hover:text-zinc-700 dark:group-hover:text-zinc-200\">\n                  {copied ? <CheckIcon className=\"size-4 text-(--accent)\" /> : <CopyIcon className=\"size-4\" />}\n                </span>\n                <span className=\"sr-only\" aria-live=\"polite\">\n                  {copied ? \"Copied\" : \"Copy the install command\"}\n                </span>\n              </button>\n              <Jot\n                to={installRef}\n                from=\"left\"\n                at=\"right\"\n                bend={-0.5}\n                tilt={-2}\n                trigger=\"mount\"\n                delay={0.4}\n                className=\"absolute top-1/2 left-full mt-4 ml-9 hidden max-w-none whitespace-nowrap text-zinc-600 xl:block dark:text-zinc-300\"\n              >\n                {NOTES.install}\n              </Jot>\n            </div>\n          </div>\n          <p className=\"mt-5 text-sm text-zinc-500 dark:text-zinc-400\">{FOOTNOTE}</p>\n        </div>\n\n        {/* Two devices on one list, with a clear channel between them for the note's arrow. Tick a\n            row on either and its copy on the other flashes as it lands. */}\n        <div className=\"relative mx-auto w-full max-w-[37rem] pt-20\">\n          <Jot\n            to={noteTarget}\n            from=\"bottom\"\n            at={last?.from === \"phone\" ? \"right\" : \"left\"}\n            bend={last?.from === \"phone\" ? 0.3 : -0.3}\n            tilt={-1.5}\n            trigger=\"mount\"\n            delay={1.2}\n            className=\"absolute top-0 left-[57%] z-20 hidden max-w-none -translate-x-1/2 whitespace-nowrap text-zinc-600 md:block dark:text-zinc-300\"\n          >\n            {last ? NOTES.synced[last.from === \"phone\" ? \"laptop\" : \"phone\"] : NOTES.tryIt}\n          </Jot>\n\n          <div className=\"flex items-center justify-center gap-10\">\n            <Laptop done={done} flash={last?.from === \"phone\" ? last : null} latency={latency} onToggle={(id) => toggle(id, \"laptop\")} />\n            <Phone done={done} flash={last?.from === \"laptop\" ? last : null} latency={latency} onToggle={(id) => toggle(id, \"phone\")} />\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n\n/* ── The two devices ─────────────────────────────────────── */\n\ntype DeviceProps = {\n  done: Set<string>;\n  flash: { id: string; n: number } | null;\n  latency: number;\n  onToggle: (id: string) => void;\n};\n\nfunction Laptop({ done, flash, latency, onToggle }: DeviceProps) {\n  return (\n    <div className=\"hidden min-w-0 flex-1 overflow-hidden rounded-xl bg-white shadow-[0_24px_60px_-24px_rgb(0_0_0/0.35)] ring-1 ring-zinc-950/10 sm:block dark:bg-zinc-900 dark:ring-white/10\">\n      <div className=\"flex h-8 items-center gap-1.5 border-b border-zinc-950/[0.06] bg-zinc-50 px-3 dark:border-white/[0.06] dark:bg-white/[0.03]\">\n        <span className=\"size-2.5 rounded-full bg-[#ff5f57]\" />\n        <span className=\"size-2.5 rounded-full bg-[#febc2e]\" />\n        <span className=\"size-2.5 rounded-full bg-[#28c840]\" />\n        <span className=\"ml-auto text-[11px] font-medium text-zinc-500 dark:text-zinc-400\">Halden Lab</span>\n        <span className=\"ml-auto w-[38px]\" />\n      </div>\n      <div className=\"p-4\">\n        <p className=\"px-2 text-sm font-semibold\">{LIST_TITLE}</p>\n        <ul className=\"mt-2.5 space-y-0.5\">\n          {TASKS.map((task) => (\n            <Row key={task.id} device=\"laptop\" task={task} checked={done.has(task.id)} flash={flash} onToggle={onToggle} compact />\n          ))}\n        </ul>\n        <Status latency={latency} />\n      </div>\n    </div>\n  );\n}\n\nfunction Phone({ done, flash, latency, onToggle }: DeviceProps) {\n  return (\n    <div className=\"relative w-[14.5rem] shrink-0 rounded-[2.4rem] bg-zinc-950 p-2 shadow-[0_30px_60px_-20px_rgb(0_0_0/0.45)] ring-1 ring-black/40 dark:ring-white/15\">\n      <div className=\"overflow-hidden rounded-[1.9rem] bg-white dark:bg-zinc-900\">\n        <div className=\"flex items-center justify-between px-6 pt-3 text-[11px] font-semibold\">\n          <span>9:41</span>\n          <span className=\"h-4 w-16 rounded-full bg-zinc-950\" />\n          <span className=\"flex gap-0.5\">\n            <span className=\"h-2 w-0.5 rounded-sm bg-current\" />\n            <span className=\"h-2.5 w-0.5 rounded-sm bg-current\" />\n            <span className=\"h-3 w-0.5 rounded-sm bg-current\" />\n          </span>\n        </div>\n        <div className=\"px-4 pt-5 pb-4\">\n          <p className=\"text-[11px] font-medium text-zinc-500 dark:text-zinc-400\">Halden Lab</p>\n          <p className=\"mt-0.5 text-lg font-semibold tracking-tight\">{LIST_TITLE}</p>\n          <ul className=\"mt-3 space-y-1\">\n            {TASKS.map((task) => (\n              <Row key={task.id} device=\"phone\" task={task} checked={done.has(task.id)} flash={flash} onToggle={onToggle} />\n            ))}\n          </ul>\n          <Status latency={latency} />\n        </div>\n      </div>\n    </div>\n  );\n}\n\nfunction Row({\n  device,\n  task,\n  checked,\n  flash,\n  onToggle,\n  compact,\n}: {\n  device: Device;\n  task: (typeof TASKS)[number];\n  checked: boolean;\n  flash: { id: string; n: number } | null;\n  onToggle: (id: string) => void;\n  compact?: boolean;\n}) {\n  const flashing = flash?.id === task.id;\n  return (\n    <li data-row={`${device}-${task.id}`} className=\"relative\">\n      {flashing ? (\n        <motion.span\n          key={flash.n}\n          aria-hidden\n          initial={{ opacity: 1 }}\n          animate={{ opacity: 0 }}\n          transition={{ duration: 1.4, ease: [0.22, 1, 0.36, 1], delay: 0.08 }}\n          className=\"pointer-events-none absolute inset-0 rounded-lg bg-(--accent)/15\"\n        />\n      ) : null}\n      <label\n        className={`relative flex cursor-pointer items-center gap-2.5 rounded-lg px-2 has-focus-visible:outline-2 has-focus-visible:outline-(--accent) ${compact ? \"py-1.5 text-[13px]\" : \"py-2.5 text-sm\"}`}\n      >\n        <input type=\"checkbox\" checked={checked} onChange={() => onToggle(task.id)} className=\"peer sr-only\" />\n        <span\n          aria-hidden\n          className={`grid size-[18px] shrink-0 place-items-center rounded-full ring-1 transition-colors duration-150 ${\n            checked ? \"bg-(--accent) ring-(--accent)\" : \"ring-zinc-300 dark:ring-zinc-600\"\n          }`}\n        >\n          {checked ? <CheckIcon className=\"size-3 text-white dark:text-zinc-950\" /> : null}\n        </span>\n        <span className={checked ? \"text-zinc-400 line-through decoration-zinc-300 dark:text-zinc-500 dark:decoration-zinc-600\" : \"\"}>\n          {task.label}\n        </span>\n      </label>\n    </li>\n  );\n}\n\nfunction Status({ latency }: { latency: number }) {\n  return (\n    <p className=\"mt-3 flex items-center gap-1.5 px-2 text-[11px] text-zinc-500 tabular-nums dark:text-zinc-400\">\n      <span className=\"size-1.5 rounded-full bg-emerald-500\" />\n      Synced in {latency} ms\n    </p>\n  );\n}\n\n/* ── Icons ───────────────────────────────────────────────── */\n\nfunction ShoalMark({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" className={className} aria-hidden>\n      <path d=\"M3 8.5c3-2.4 6-2.4 9 0s6 2.4 9 0\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.2} strokeLinecap=\"round\" />\n      <path d=\"M3 15.5c3-2.4 6-2.4 9 0s6 2.4 9 0\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.2} strokeLinecap=\"round\" opacity={0.5} />\n    </svg>\n  );\n}\n\nfunction CopyIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} className={className} aria-hidden>\n      <rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8\" rx=\"1.5\" />\n      <path d=\"M10.5 5.5V4a1.5 1.5 0 0 0-1.5-1.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5\" />\n    </svg>\n  );\n}\n\nfunction CheckIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} className={className} aria-hidden>\n      <path d=\"m3.5 8.5 3 3 6-7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n    </svg>\n  );\n}\n"
    }
  ]
}