{"version":3,"file":"SpreadGrowHeight.drvxiAC9.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/0f1PenJZWrtSpxL13Oty/bMfvMRXPGau7591Q3plT/SpreadGrowHeight.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useScroll,useTransform}from\"framer-motion\";export function SpreadNoSpringPinnedCenter(Component){return /*#__PURE__*/React.forwardRef((props,_ignored)=>{const sectionRef=React.useRef(null);// ——— measure base height (unchanged) ———\nconst[baseHeight,setBaseHeight]=React.useState(0);React.useLayoutEffect(()=>{const el=sectionRef.current;if(!el)return;const h=el.clientHeight;setBaseHeight(h>0?h:0);},[]);// ——— scroll progress (unchanged, or tweak offsets later if you want faster) ———\nconst{scrollYProgress}=useScroll({target:sectionRef,offset:[\"start 90%\",\"end -50%\"]})// docs: useScroll / useTransform\n;// motion.dev/docs/react-use-scroll , motion.dev/docs/react-scroll-animations\nconst GAP_PER_STEP=150;// ——— map progress → spacing (unchanged) ———\nconst step=useTransform(scrollYProgress,[0,1],[0,GAP_PER_STEP]);const tiles=React.Children.toArray(props.children??[]);const injectY=(child,idx)=>{const y=useTransform(step,v=>idx*v);if(/*#__PURE__*/React.isValidElement(child)){const prevStyle=child.props?.style||{};return /*#__PURE__*/React.cloneElement(child,{style:{...prevStyle,y}});}return child;};// ——— grow container height so nothing gets clipped (unchanged) ———\nconst extraSpread=useTransform(step,v=>Math.max(0,(tiles.length-1)*v));const minHeight=useTransform(extraSpread,grow=>baseHeight+grow);return /*#__PURE__*/_jsx(motion.div,{ref:sectionRef,style:{position:\"relative\",width:\"100%\",minHeight,overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"sticky\",top:0,height:\"100vh\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\",zIndex:1},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",pointerEvents:\"auto\"},children:/*#__PURE__*/_jsx(Component,{...props,children:tiles.map((child,idx)=>injectY(child,idx))})})})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"SpreadNoSpringPinnedCenter\":{\"type\":\"reactHoc\",\"name\":\"SpreadNoSpringPinnedCenter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SpreadGrowHeight.map"],"mappings":"wTAAgI,SAAgB,EAA2B,EAAU,CAAC,OAAoB,GAAkB,EAAM,IAAW,CAAC,IAAM,EAAWA,EAAa,KAAK,CAC5Q,CAAC,EAAW,GAAeC,EAAe,EAAE,CAAC,MAA0B,CAAC,IAAM,EAAG,EAAW,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAE,EAAG,aAAa,EAAc,EAAE,EAAE,EAAE,EAAE,EAAG,EAAE,CAAC,CAC3K,GAAK,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAW,OAAO,CAAC,YAAY,WAAW,CAAC,CAAC,CAG/E,EAAK,EAAa,EAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,EAD5B,IAC2C,CAAC,CAAO,EAAA,EAAqB,QAAQ,EAAM,UAAU,EAAE,CAAC,CAAO,GAAS,EAAM,IAAM,CAAC,IAAM,EAAE,EAAa,EAAK,GAAG,EAAI,EAAE,CAAC,GAAgB,EAAqB,EAAM,CAAC,CAAC,IAAM,EAAU,EAAM,OAAO,OAAO,EAAE,CAAC,OAAoB,EAAmB,EAAM,CAAC,MAAM,CAAC,GAAG,EAAU,IAAE,CAAC,CAAC,CAAE,OAAO,GACpV,EAAY,EAAa,EAAK,GAAG,KAAK,IAAI,GAAG,EAAM,OAAO,GAAG,EAAE,CAAC,CAAO,EAAU,EAAa,EAAY,GAAM,EAAW,EAAK,CAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,IAAI,EAAW,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,YAAU,SAAS,UAAU,CAAC,SAAsB,EAAK,MAAM,CAAC,MAAM,CA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