{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "counter-curtain-editorial-demo",
  "type": "registry:block",
  "title": "Counter Curtain: Editorial",
  "description": "Page Preloader example, Editorial: The default counter set in serif on a stone curtain that slides off to the left. It waits for the three photos to load and decode, so they're sharp from the first frame. A take on the preloader (loading screen). Fits preloader, hero and portfolio sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "preloader",
    "hero",
    "portfolio",
    "number-counter",
    "text"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/counter-curtain#counter-curtain-editorial-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/counter-curtain.json"
  ],
  "files": [
    {
      "path": "components/counter-curtain-editorial-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { CounterCurtain, CounterCurtainLine } from \"@/components/ui/counter-curtain\";\n\nconst image = (id: string) =>\n  `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=900&h=1100&q=80`;\n\nconst rooms = [\n  { id: \"1618221195710-dd6b41faaea6\", alt: \"A long open living room with a sofa, coffee table and wide windows\", caption: \"The long room\" },\n  { id: \"1586023492125-27b2c045efd7\", alt: \"A yellow armchair beside a floor lamp against a white wall\", caption: \"Reading corner\" },\n  { id: \"1555041469-a586c61ea9bc\", alt: \"A green velvet sofa on a pale wooden floor\", caption: \"The snug\" },\n];\n\n// The default counter, restyled with curtainClassName, leaving to the left.\n// It waits for the three photos, so they're decoded and sharp before anything\n// is uncovered.\nexport function CounterCurtainEditorialDemo() {\n  const [run, setRun] = React.useState(0);\n\n  return (\n    <div className=\"flex h-[var(--demo-height,36rem)] w-full flex-col overflow-hidden rounded-xl border border-stone-200 bg-stone-50 text-stone-900 dark:border-stone-800 dark:bg-stone-950 dark:text-stone-100\">\n      <BrowserBar url=\"hollow-house.journal\" run={run} onReload={() => setRun((r) => r + 1)} />\n      <CounterCurtain\n        key={run}\n        contained\n        once={false}\n        direction=\"left\"\n        curtainClassName=\"bg-stone-200 font-serif text-stone-900 dark:bg-stone-800 dark:text-stone-100\"\n        className=\"@container min-h-0 flex-1\"\n      >\n        <div className=\"flex h-full flex-col px-5 pt-4 pb-5 sm:px-8 sm:pt-5 sm:pb-7\">\n          <header className=\"flex items-baseline justify-between border-b border-stone-300/70 pb-3 text-sm dark:border-stone-700/70\">\n            <CounterCurtainLine className=\"font-serif text-lg italic\">Hollow House</CounterCurtainLine>\n            <CounterCurtainLine className=\"text-xs tracking-[0.18em] text-stone-500 uppercase\">\n              Issue 12 · Autumn\n            </CounterCurtainLine>\n          </header>\n\n          <div className=\"mt-6 grid min-h-0 flex-1 gap-6 @2xl:grid-cols-[1fr_1.35fr] @2xl:gap-10\">\n            <div className=\"flex flex-col justify-end\">\n              <h1 className=\"font-serif text-[clamp(2.5rem,7.5cqw,5.75rem)] leading-[0.95] tracking-[-0.03em]\">\n                <CounterCurtainLine>Rooms that</CounterCurtainLine>{\" \"}\n                <CounterCurtainLine>hold the</CounterCurtainLine>{\" \"}\n                <CounterCurtainLine className=\"italic\">light.</CounterCurtainLine>\n              </h1>\n              <CounterCurtainLine className=\"mt-5 max-w-xs text-sm leading-relaxed text-pretty text-stone-600 dark:text-stone-400\">\n                A 1930s terrace in Bergen, opened up from the front door to the garden\n                and furnished one chair at a time.\n              </CounterCurtainLine>\n            </div>\n            <div className=\"hidden min-h-0 grid-cols-3 items-end gap-3 @2xl:grid\">\n              {rooms.map((room, index) => (\n                <figure key={room.id} className={index === 1 ? \"pb-10\" : undefined}>\n                  <CounterCurtainLine className=\"rounded-md\">\n                    <img\n                      src={image(room.id)}\n                      alt={room.alt}\n                      className=\"aspect-[4/5] w-full rounded-md object-cover\"\n                    />\n                  </CounterCurtainLine>\n                  <CounterCurtainLine className=\"mt-2 font-serif text-xs text-stone-500 italic\">\n                    {room.caption}\n                  </CounterCurtainLine>\n                </figure>\n              ))}\n            </div>\n          </div>\n        </div>\n      </CounterCurtain>\n    </div>\n  );\n}\n\nfunction BrowserBar({ url, run, onReload }: { url: string; run: number; onReload: () => void }) {\n  return (\n    <div className=\"flex h-10 shrink-0 items-center gap-3 border-b border-stone-200 bg-white/60 px-3 dark:border-stone-800 dark:bg-stone-900/60\">\n      <div aria-hidden className=\"flex gap-1.5\">\n        {[0, 1, 2].map((dot) => (\n          <span key={dot} className=\"size-2.5 rounded-full bg-stone-300 dark:bg-stone-700\" />\n        ))}\n      </div>\n      <button\n        type=\"button\"\n        onClick={onReload}\n        aria-label=\"Reload to play it again\"\n        title=\"Play again\"\n        className=\"grid size-7 place-items-center rounded-md text-stone-500 transition-[background-color,color,scale] duration-150 hover:bg-stone-200/70 hover:text-stone-900 active:scale-[0.94] dark:hover:bg-stone-800 dark:hover:text-stone-100\"\n      >\n        <svg\n          viewBox=\"0 0 16 16\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"1.5\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          className=\"size-3.5 transition-[rotate] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]\"\n          style={{ rotate: `${run * 360}deg` }}\n        >\n          <path d=\"M13.5 8a5.5 5.5 0 1 1-1.6-3.9\" />\n          <path d=\"M13.5 2.5v3h-3\" />\n        </svg>\n      </button>\n      <span className=\"mx-auto truncate rounded-md bg-stone-100 px-3 py-1 font-mono text-[11px] text-stone-500 dark:bg-stone-800/80 dark:text-stone-400\">\n        {url}\n      </span>\n      <span aria-hidden className=\"w-[4.75rem]\" />\n    </div>\n  );\n}\n"
    }
  ]
}