{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "golden-hour-cta-demo",
  "type": "registry:block",
  "title": "Golden Hour: Sunset Sign-Up",
  "description": "Sunset Scene Background example, Sunset Sign-Up: A newsletter's closing section. The sun sets as it comes into view, and subscribing brings the night and the moon out. A take on the animated background (backdrop). Fits hero, CTA and features sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "cta",
    "features",
    "animated-background",
    "background",
    "svg"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/golden-hour#golden-hour-cta-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/golden-hour.json"
  ],
  "files": [
    {
      "path": "components/golden-hour-cta-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useInView } from \"motion/react\";\n\nimport { GoldenHour } from \"@/components/ui/golden-hour\";\n\n// Golden hour on the way down the page, the sun just set once the section is\n// in view, and night with the moon up after the visitor subscribes.\nconst ARRIVING = 17.6;\nconst ARRIVED = 19;\nconst SUBSCRIBED = 21.6;\n\nexport function GoldenHourCtaDemo() {\n  const ref = React.useRef<HTMLDivElement>(null);\n  const inView = useInView(ref, { amount: 0.6 });\n  const [email, setEmail] = React.useState(\"\");\n  const [sent, setSent] = React.useState(false);\n  const hour = sent ? SUBSCRIBED : inView ? ARRIVED : ARRIVING;\n\n  return (\n    <div ref={ref} className=\"w-full max-w-4xl\">\n      <GoldenHour\n        time={hour}\n        horizon={0.68}\n        className=\"flex min-h-[30rem] flex-col items-center rounded-3xl px-6 pt-14 text-center text-white sm:min-h-[32rem] sm:pt-20\"\n      >\n        <p className=\"flex items-center gap-2 text-sm font-medium text-white/80\">\n          <SunMark className=\"size-4\" />\n          Long Light · Fridays\n        </p>\n        <h2 className=\"mt-4 max-w-[17ch] text-4xl/[1.05] font-medium tracking-[-0.035em] text-balance sm:text-5xl/[1.02]\">\n          One slow email a week, sent at sunset.\n        </h2>\n        <p className=\"mt-4 max-w-md text-base/7 text-pretty text-white/80\">\n          Five places worth the detour, and the hour to be there. Read by 18,000 people who would rather be outside.\n        </p>\n\n        <div className=\"mt-8 w-full max-w-md\" aria-live=\"polite\">\n          {sent ? (\n            <div className=\"flex min-h-[52px] items-center justify-center gap-2 rounded-full bg-zinc-950/20 px-5 py-2 text-sm font-medium ring-1 ring-white/25 backdrop-blur-xl\">\n              <CheckIcon className=\"size-4\" />\n              You&apos;re on the list. The first letter lands Friday, just before sunset.\n            </div>\n          ) : (\n            <form\n              onSubmit={(event) => {\n                event.preventDefault();\n                if (email.includes(\"@\")) setSent(true);\n              }}\n              className=\"flex h-[52px] items-center gap-2 rounded-full bg-zinc-950/20 p-1.5 ring-1 ring-white/25 backdrop-blur-xl focus-within:ring-white/60\"\n            >\n              <label htmlFor=\"golden-hour-cta-email\" className=\"sr-only\">\n                Email\n              </label>\n              <input\n                id=\"golden-hour-cta-email\"\n                type=\"email\"\n                required\n                value={email}\n                onChange={(event) => setEmail(event.target.value)}\n                placeholder=\"you@example.com\"\n                className=\"h-full min-w-0 flex-1 bg-transparent pl-4 text-sm text-white outline-none placeholder:text-white/70\"\n              />\n              <button\n                type=\"submit\"\n                className=\"h-full shrink-0 rounded-full bg-white px-5 text-sm font-medium text-zinc-950 transition-[background-color,scale] duration-150 ease-out hover:bg-white/90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white active:scale-[0.97]\"\n              >\n                Subscribe\n              </button>\n            </form>\n          )}\n        </div>\n        <p className=\"mt-3 text-xs text-white/70\">No spam. Unsubscribe in one click.</p>\n      </GoldenHour>\n    </div>\n  );\n}\n\nfunction SunMark({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" className={className} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.4} aria-hidden>\n      <path d=\"M2 11.5h12M4.5 11.5a3.5 3.5 0 0 1 7 0M8 3v1.6M3.4 5.4l1.1 1.1M12.6 5.4l-1.1 1.1\" strokeLinecap=\"round\" />\n    </svg>\n  );\n}\n\nfunction CheckIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" className={className} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.8} aria-hidden>\n      <path d=\"m3.5 8.5 3 3 6-7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n    </svg>\n  );\n}\n"
    }
  ]
}