{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"scroll-linked-image-mask-reveal","type":"registry:component","title":"Scroll-Linked Image Mask Reveal","description":"An image whose circular clip-path mask grows and shrinks in lockstep with scroll.","dependencies":["framer-motion"],"registryDependencies":[],"files":[{"path":"components/viberdy/scroll-linked-image-mask-reveal.tsx","content":"\"use client\";\n\nimport { useRef } from \"react\";\nimport { motion, useScroll, useTransform } from \"framer-motion\";\n\nexport function ScrollLinkedImageMaskReveal({ src, alt = \"\" }: { src: string; alt?: string }) {\n  const targetRef = useRef<HTMLDivElement>(null);\n\n  const { scrollYProgress } = useScroll({\n    target: targetRef,\n    offset: [\"start end\", \"end start\"],\n  });\n\n  const clipPercent = useTransform(scrollYProgress, [0, 1], [0, 75]);\n  const clipPath = useTransform(clipPercent, (v) => `circle(${v}% at 50% 50%)`);\n  const scale = useTransform(scrollYProgress, [0, 1], [1.3, 1]);\n\n  return (\n    <div ref={targetRef} className=\"relative flex h-[70vh] items-center justify-center overflow-hidden\">\n      <motion.img src={src} alt={alt} style={{ clipPath, scale }} className=\"h-full w-full object-cover\" />\n    </div>\n  );\n}\n","type":"registry:component","target":"components/viberdy/scroll-linked-image-mask-reveal.tsx"}],"meta":{"tier":"free","tags":["scroll","image","mask","reveal","clip-path"],"href":"https://viberdy.dev/library/scroll-linked-image-mask-reveal","aiPrompt":"Create a React + Tailwind + Framer Motion \"scroll-linked circular mask reveal\" component named ScrollLinkedImageMaskReveal.\n\nBehavior:\n- An image is masked by a circular clip-path whose radius is CONTINUOUSLY linked to scroll progress, not triggered once when it enters view. Use `useScroll({ target, offset: [\"start end\", \"end start\"] })` to get a 0-1 scrollYProgress motion value that tracks the target element's full pass through the viewport, then `useTransform` to map that to a clip-path circle radius percentage (e.g. 0% to 75%) and a slight scale-down (e.g. 1.3 to 1) for added depth.\n- Apply the derived clip-path and scale as `style` on a `motion.img` (or a motion.div wrapping the image) — since these are motion values, not React state, they update every scroll frame without triggering component re-renders.\n- The key distinction from a \"reveal on scroll into view\" component: this one tracks the CONTINUOUS scroll position bidirectionally — scrolling partway shows a partial reveal, and scrolling back up shrinks it again, rather than firing once and staying done.\n- Props: src, alt.\n\nStyle: full-bleed image section, smooth continuous reveal tied 1:1 to scroll, no easing/animation duration involved since it's driven directly by scroll position.\n\nOutput a single self-contained \"use client\" component.","license":"https://viberdy.dev/license"}}