{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pulse-waitlist-demo",
  "type": "registry:block",
  "title": "Pulse: Waitlist",
  "description": "Live Data Dot Grid Background example, Waitlist: A language tutor's waitlist where signups land on their cities and joining drops an orange ring labelled You, roughly where you are. A take on the animated background (backdrop). Fits hero, CTA and stats sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "cta",
    "stats",
    "animated-background",
    "chart",
    "map",
    "background",
    "data",
    "canvas"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/pulse#pulse-waitlist-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/pulse.json"
  ],
  "files": [
    {
      "path": "components/pulse-waitlist-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Pulse, type PulseEvent } from \"@/components/ui/pulse\";\n\n// A flattened world map squeezed into the top half of the box, where the copy doesn't cover it.\nconst place = (lon: number, lat: number) => ({\n  x: 0.04 + ((lon + 180) / 360) * 0.92,\n  y: Math.min(0.44, Math.max(0.05, 0.06 + (((90 - lat) / 180 - 0.2) / 0.5) * 0.34)),\n});\n\nconst CITIES = [\n  { name: \"Lisbon\", ...place(-9.1, 38.7) },\n  { name: \"Seoul\", ...place(127, 37.6) },\n  { name: \"Austin\", ...place(-97.7, 30.3) },\n  { name: \"Lagos\", ...place(3.4, 6.5) },\n  { name: \"São Paulo\", ...place(-46.6, -23.5) },\n  { name: \"Berlin\", ...place(13.4, 52.5) },\n  { name: \"Mumbai\", ...place(72.9, 19.1) },\n  { name: \"Tokyo\", ...place(139.7, 35.7) },\n  { name: \"Toronto\", ...place(-79.4, 43.7) },\n  { name: \"Mexico City\", ...place(-99.1, 19.4) },\n  { name: \"Nairobi\", ...place(36.8, -1.3) },\n  { name: \"Sydney\", ...place(151.2, -33.9) },\n  { name: \"Jakarta\", ...place(106.8, -6.2) },\n  { name: \"Paris\", ...place(2.35, 48.9) },\n];\n\n/** A rough guess at where the visitor is, from their time zone alone: no prompt, no lookup. */\nfunction whereYouAre() {\n  const zone = Intl.DateTimeFormat().resolvedOptions().timeZone ?? \"\";\n  const lon = (-new Date().getTimezoneOffset() / 60) * 15;\n  const area = zone.split(\"/\")[0];\n  const lat =\n    area === \"Europe\" ? 48\n    : area === \"Africa\" ? 5\n    : area === \"Asia\" ? 28\n    : area === \"Australia\" ? -30\n    : area === \"Pacific\" ? -15\n    : area === \"America\" ? (lon > -50 ? -20 : 38)\n    : 40;\n  return place(lon, lat);\n}\n\nlet nextId = 0;\n\nexport function PulseWaitlistDemo() {\n  const [events, setEvents] = React.useState<PulseEvent[]>([]);\n  const [count, setCount] = React.useState(12_481);\n  const [latest, setLatest] = React.useState(\"Lisbon\");\n  const [email, setEmail] = React.useState(\"\");\n  const [joined, setJoined] = React.useState<number | null>(null);\n\n  // Signups from around the world, one every 0.9–2.6s.\n  React.useEffect(() => {\n    let timer = 0;\n    const tick = () => {\n      const city = CITIES[Math.floor(Math.random() * CITIES.length)];\n      const jitter = () => (Math.random() - 0.5) * 0.025;\n      setEvents((list) => [\n        ...list.slice(-11),\n        { id: `signup-${nextId++}`, x: city.x + jitter(), y: city.y + jitter(), strength: 0.35 + Math.random() * 0.2, tone: \"ink\", label: city.name },\n      ]);\n      setCount((n) => n + 1);\n      setLatest(city.name);\n      timer = window.setTimeout(tick, 900 + Math.random() * 1700);\n    };\n    timer = window.setTimeout(tick, 600);\n    return () => window.clearTimeout(timer);\n  }, []);\n\n  const join = (e: React.FormEvent) => {\n    e.preventDefault();\n    if (joined) return;\n    const you = whereYouAre();\n    setEvents((list) => [...list.slice(-11), { id: `you-${nextId++}`, ...you, strength: 1, tone: \"accent\", label: \"You\" }]);\n    setJoined(count + 1);\n    setCount((n) => n + 1);\n    setLatest(\"You\");\n  };\n\n  return (\n    <Pulse\n      events={events}\n      className=\"flex h-[var(--demo-height,36rem)] w-full flex-col justify-end rounded-2xl border border-border bg-background text-foreground\"\n    >\n      {/* The map lives in the top half; the copy sits on a clean ground below it. */}\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 bg-[linear-gradient(to_bottom,transparent_34%,var(--background)_58%)]\"\n      />\n\n      <div className=\"relative grid gap-6 px-6 pb-7 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end sm:gap-8 sm:px-10 sm:pb-10\">\n        <div className=\"max-w-lg\">\n          <h2 className=\"text-3xl/[1.08] font-semibold tracking-tight text-balance sm:text-5xl/[1.04]\">\n            Talk your way into a new language\n          </h2>\n          <p className=\"mt-4 max-w-md text-base/7 text-pretty text-muted-foreground\">\n            Parlance is a tutor you speak with, not tap at. It hears your accent, fixes it gently and\n            remembers every word you trip on. The list opens in March.\n          </p>\n\n          <form onSubmit={join} className=\"mt-6 flex h-12 max-w-md items-center rounded-full border border-border bg-background p-1 shadow-sm transition-colors focus-within:border-foreground/40\">\n            <label htmlFor=\"parlance-email\" className=\"sr-only\">\n              Email\n            </label>\n            <input\n              id=\"parlance-email\"\n              type=\"email\"\n              required\n              readOnly={joined !== null}\n              value={email}\n              onChange={(e) => setEmail(e.target.value)}\n              placeholder=\"you@example.com\"\n              className=\"h-full min-w-0 flex-1 bg-transparent px-4 text-sm outline-none placeholder:text-muted-foreground read-only:text-muted-foreground\"\n            />\n            <button\n              type=\"submit\"\n              disabled={joined !== null}\n              className=\"inline-flex h-full shrink-0 items-center gap-1.5 rounded-full bg-foreground px-5 text-sm font-medium text-background transition-opacity hover:opacity-85 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground disabled:bg-[#ff5a1f] disabled:text-zinc-950 disabled:hover:opacity-100\"\n            >\n              {joined !== null ? (\n                <>\n                  <svg aria-hidden viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2}>\n                    <path d=\"M3.5 8.5l3 3 6-7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                  </svg>\n                  Joined\n                </>\n              ) : (\n                \"Join the list\"\n              )}\n            </button>\n          </form>\n          <p role=\"status\" aria-live=\"polite\" className=\"mt-3 min-h-5 text-sm text-muted-foreground\">\n            {joined !== null ? `You're number ${joined.toLocaleString(\"en-US\")}. We'll write when your city opens.` : \"\"}\n          </p>\n        </div>\n\n        <div className=\"flex flex-wrap items-baseline gap-x-3 gap-y-1 sm:block sm:text-right\">\n          <p className=\"text-3xl font-semibold tracking-tight tabular-nums sm:text-5xl\">{count.toLocaleString(\"en-US\")}</p>\n          <p className=\"text-sm text-muted-foreground sm:mt-1\">people on the list</p>\n          <p className=\"w-full font-mono text-xs text-muted-foreground sm:mt-3\">\n            Latest · <span className={latest === \"You\" ? \"text-[#e64a12] dark:text-[#ff6a3d]\" : \"text-foreground\"}>{latest}</span>\n          </p>\n        </div>\n      </div>\n    </Pulse>\n  );\n}\n"
    }
  ]
}