{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sticky-deck-case-studies-demo",
  "type": "registry:block",
  "title": "Sticky Deck: Case Studies",
  "description": "Stacking Cards on Scroll example, Case Studies: A studio portfolio on photo cards, with tighter edges and a deeper dim for a dark page. Each photo settles from a slight zoom as its card lands, driven by `useStickyDeckCard()`, and the counter at the top rolls to the front card's number. A take on the stacking cards (card stack) and scroll animation (on scroll). Fits features, testimonials and pricing sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "testimonials",
    "pricing",
    "stacking-cards",
    "scroll-animation",
    "scroll",
    "cards",
    "sticky"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/sticky-deck#sticky-deck-case-studies-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/sticky-deck.json"
  ],
  "files": [
    {
      "path": "components/sticky-deck-case-studies-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, easeOut, motion, useReducedMotion, useTransform } from \"motion/react\";\n\nimport { StickyDeck, StickyDeckCard, useStickyDeckCard } from \"@/components/ui/sticky-deck\";\n\nconst projects = [\n  {\n    client: \"Lumen Roasters\",\n    headline: \"A coffee brand that sells out every Tuesday\",\n    services: \"Identity · Shop\",\n    year: 2026,\n    stat: \"+62% repeat orders\",\n    photo: \"1511920170033-f8396924c348\",\n    alt: \"An espresso being pulled into a small glass\",\n  },\n  {\n    client: \"Atlas Run\",\n    headline: \"The launch site for a carbon racer\",\n    services: \"Launch · 3D\",\n    year: 2025,\n    stat: \"1.2M visits in launch week\",\n    photo: \"1542291026-7eec264c27ff\",\n    alt: \"A red running shoe on a red background\",\n  },\n  {\n    client: \"Kōen Travel\",\n    headline: \"Booking a Kyoto ryokan in three taps\",\n    services: \"Product · iOS\",\n    year: 2025,\n    stat: \"4.9 on the App Store\",\n    photo: \"1545569341-9eb8b30979d9\",\n    alt: \"A pagoda above the rooftops of Kyoto at dusk\",\n  },\n  {\n    client: \"Moss & Velvet\",\n    headline: \"Furniture you can sit in before it ships\",\n    services: \"Commerce · AR\",\n    year: 2024,\n    stat: \"31% fewer returns\",\n    photo: \"1555041469-a586c61ea9bc\",\n    alt: \"A green velvet sofa on a pale wooden floor\",\n  },\n  {\n    client: \"Prism Labs\",\n    headline: \"A brand system that bends with the light\",\n    services: \"Identity · Motion\",\n    year: 2024,\n    stat: \"212 brand assets\",\n    photo: \"1557672172-298e090bd0f1\",\n    alt: \"Swirls of liquid marble in blue and pink\",\n  },\n];\n\nconst photo = (id: string) => `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=1400&h=900&q=80`;\n\nexport function StickyDeckCaseStudiesDemo() {\n  const scrollRef = React.useRef<HTMLDivElement>(null);\n  const [active, setActive] = React.useState(0);\n\n  return (\n    <div className=\"relative w-full overflow-hidden rounded-xl border border-zinc-800 bg-zinc-950 text-white\">\n      <div ref={scrollRef} className=\"relative h-[var(--demo-height,36rem)] overflow-y-auto overscroll-contain\">\n        <div className=\"sticky top-0 z-10 flex items-center justify-between bg-linear-to-b from-zinc-950 from-60% to-transparent px-5 pt-4 pb-6 font-mono text-[11px] tracking-widest text-white/50 uppercase sm:px-8\">\n          <span>Selected work</span>\n          <span className=\"flex tabular-nums\">\n            <span className=\"relative inline-flex h-4 w-[2ch] overflow-hidden\">\n              <AnimatePresence initial={false} mode=\"popLayout\">\n                <motion.span\n                  key={active}\n                  initial={{ y: \"100%\", opacity: 0 }}\n                  animate={{ y: 0, opacity: 1 }}\n                  exit={{ y: \"-100%\", opacity: 0 }}\n                  transition={{ type: \"spring\", visualDuration: 0.35, bounce: 0 }}\n                  className=\"text-white\"\n                >\n                  {String(active + 1).padStart(2, \"0\")}\n                </motion.span>\n              </AnimatePresence>\n            </span>\n            &nbsp;/ {String(projects.length).padStart(2, \"0\")}\n          </span>\n        </div>\n\n        <div className=\"mx-auto max-w-5xl px-4 sm:px-8\">\n          <header className=\"pt-10 pb-14 sm:pt-16\">\n            <h2 className=\"max-w-lg text-4xl/[1.05] font-semibold tracking-tight text-balance sm:text-5xl/[1.05]\">\n              Five launches, start to finish\n            </h2>\n            <p className=\"mt-4 max-w-sm text-sm/6 text-pretty text-white/55\">\n              Brand, product and launch work for teams who ship. Tap a photo&apos;s edge to go back to it.\n            </p>\n          </header>\n\n          <StickyDeck\n            containerRef={scrollRef}\n            onActiveChange={setActive}\n            top={112}\n            offsetStep={14}\n            scaleTo={0.92}\n            dimTo={0.62}\n            hold={120}\n            className=\"gap-10\"\n          >\n            {projects.map((project) => (\n              <StickyDeckCard\n                key={project.client}\n                className=\"h-[min(26rem,calc(var(--demo-height,36rem)-9.5rem))] overflow-hidden rounded-3xl bg-zinc-800 shadow-[0_-16px_40px_-12px_rgb(0_0_0/0.7)] ring-1 ring-white/10\"\n              >\n                <ProjectPhoto src={photo(project.photo)} alt={project.alt} />\n                <div className=\"absolute inset-0 bg-linear-to-t from-black/85 via-black/25 to-black/10\" />\n                <div className=\"relative flex h-full flex-col justify-between p-5 sm:p-8\">\n                  <div className=\"flex items-center justify-between gap-3 text-xs text-white/75\">\n                    <span className=\"rounded-full bg-black/30 px-2.5 py-1 font-medium backdrop-blur-md\">\n                      {project.client}\n                    </span>\n                    <span className=\"font-mono tabular-nums\">{project.year}</span>\n                  </div>\n                  <div className=\"flex flex-wrap items-end justify-between gap-x-8 gap-y-4\">\n                    <div className=\"max-w-md\">\n                      <p className=\"font-mono text-[11px] tracking-widest text-white/60 uppercase\">\n                        {project.services}\n                      </p>\n                      <h3 className=\"mt-2 text-2xl/tight font-semibold tracking-tight text-balance sm:text-3xl/tight\">\n                        {project.headline}\n                      </h3>\n                    </div>\n                    <div className=\"flex items-center gap-4\">\n                      <span className=\"text-sm text-white/70\">{project.stat}</span>\n                      <a\n                        href=\"#\"\n                        className=\"group flex items-center gap-1.5 rounded-full bg-white px-3.5 py-1.5 text-sm font-medium text-zinc-900 transition-colors hover:bg-white/85\"\n                      >\n                        Case study\n                        <svg\n                          viewBox=\"0 0 16 16\"\n                          fill=\"none\"\n                          stroke=\"currentColor\"\n                          strokeWidth=\"1.75\"\n                          aria-hidden\n                          className=\"size-3.5 transition-transform duration-200 ease-out group-hover:translate-x-0.5\"\n                        >\n                          <path d=\"M3 8h10m0 0L9 4m4 4-4 4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                        </svg>\n                      </a>\n                    </div>\n                  </div>\n                </div>\n              </StickyDeckCard>\n            ))}\n          </StickyDeck>\n\n          <footer className=\"flex h-[calc(var(--demo-height,36rem)-4rem)] flex-col items-center justify-center text-center\">\n            <p className=\"font-mono text-[11px] tracking-widest text-white/50 uppercase\">Next up</p>\n            <h2 className=\"mt-3 text-3xl font-semibold tracking-tight\">Yours?</h2>\n            <a\n              href=\"#\"\n              className=\"mt-5 rounded-full border border-white/20 px-4 py-2 text-sm font-medium transition-colors hover:bg-white/10\"\n            >\n              Start a project\n            </a>\n          </footer>\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/** The photo settles from a slight zoom as its card travels into place. */\nfunction ProjectPhoto({ src, alt }: { src: string; alt: string }) {\n  const { progress } = useStickyDeckCard();\n  const reduce = useReducedMotion();\n  const scale = useTransform(progress, [0, 1], reduce ? [1, 1] : [1.18, 1], { ease: easeOut });\n\n  return (\n    <motion.img\n      src={src}\n      alt={alt}\n      draggable={false}\n      style={{ scale }}\n      className=\"absolute inset-0 size-full object-cover\"\n    />\n  );\n}\n"
    }
  ]
}