{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scroll-scene-demo",
  "title": "Scroll Scene Demo",
  "description": "A worked example of Scroll Scene: Turns the scrolling of a tall element into a number between nought and one, published to a custom property and to a callback, without rendering the page to do it.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/scroll-scene.json"
  ],
  "files": [
    {
      "path": "components/demos/scroll-scene-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ScrollScene } from \"@/registry/default/scroll-scene/scroll-scene\"\n\nexport function ScrollSceneDemo() {\n  const box = React.useRef<HTMLDivElement>(null)\n  const readout = React.useRef<HTMLParagraphElement>(null)\n\n  return (\n    <div className=\"border-border h-72 w-full max-w-md overflow-y-auto rounded-[var(--radius)] border\">\n      <div className=\"text-muted-foreground grid h-40 place-items-center text-xs\">\n        Scroll down inside this panel\n      </div>\n\n      <ScrollScene\n        className=\"h-[36rem]\"\n        onProgress={(progress) => {\n          // Written straight to the nodes. A scene driven by scrolling must\n          // not render the page sixty times a second.\n          if (box.current) {\n            box.current.style.transform = `rotate(${progress * 180}deg) scale(${0.6 + progress * 0.6})`\n          }\n          if (readout.current) {\n            readout.current.textContent = `${Math.round(progress * 100)} percent`\n          }\n        }}\n      >\n        <div className=\"sticky top-0 grid h-72 place-content-center justify-items-center gap-4\">\n          <div\n            ref={box}\n            className=\"bg-primary size-24 rounded-[var(--radius)]\"\n          />\n          <p\n            ref={readout}\n            className=\"text-muted-foreground text-xs tabular-nums\"\n          >\n            0 percent\n          </p>\n        </div>\n      </ScrollScene>\n\n      <div className=\"text-muted-foreground grid h-40 place-items-center text-xs\">\n        And back up again\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}