{"version":3,"file":"StackingCards.MlvaZ9ap.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/TiKLBc7kWfpAqPsEFPMI/FHsL2m3IdzpiXbfV3iJL/StackingCards.js"],"sourcesContent":["// Scrollable stacking cards component - 5 cards that stack on top of each other as user scrolls\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useScroll,useTransform}from\"framer-motion\";/**\n * Stacking Cards\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 500\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function StackingCards(props){const{cards=[],cardWidth,cardHeight,borderRadius,padding,backgroundColor,textColor,font,shadowX,shadowY,shadowBlur,shadowSpread,shadowColor}=props;const containerRef=useRef(null);const isStatic=useIsStaticRenderer();const[containerHeight,setContainerHeight]=useState(0);const{scrollYProgress}=useScroll({target:containerRef,offset:[\"start center\",\"end end\"]});useEffect(()=>{if(typeof window===\"undefined\"||isStatic)return;const updateHeight=()=>{if(containerRef.current){const viewportHeight=window.innerHeight;// Height needed to show all scroll states plus final stacked view\nconst totalHeight=viewportHeight*(cards.length+1);startTransition(()=>setContainerHeight(totalHeight));}};updateHeight();window.addEventListener(\"resize\",updateHeight);return()=>window.removeEventListener(\"resize\",updateHeight);},[cards.length,isStatic]);if(isStatic){// Static view: show all 5 cards stacked vertically\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",gap:20,padding:20,overflow:\"auto\"},children:cards.map((card,index)=>{const cardImage=card.image||{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Card Image\"};return /*#__PURE__*/_jsxs(\"div\",{style:{width:cardWidth,minHeight:cardHeight===\"auto\"?\"auto\":cardHeight,height:cardHeight===\"auto\"?\"auto\":cardHeight,borderRadius,backgroundColor,padding,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:16,boxShadow:`${shadowX}px ${shadowY}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}`,transform:`rotate(${card.tilt}deg)`,margin:\"0 auto\"},children:[/*#__PURE__*/_jsx(\"img\",{src:cardImage.src,alt:cardImage.alt,style:{width:\"100%\",height:cardHeight===\"auto\"?\"auto\":\"60%\",objectFit:\"cover\",borderRadius:borderRadius*.7}}),/*#__PURE__*/_jsx(\"p\",{style:{...font,color:textColor,margin:0,textAlign:\"center\"},children:card.text})]},index);})});}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:containerHeight||\"500vh\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"sticky\",top:0,width:\"100%\",height:\"100vh\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\"},children:cards.map((card,index)=>{const cardProgress=1/cards.length;const start=index*cardProgress;const end=(index+1)*cardProgress;const y=index===0?0:useTransform(scrollYProgress,[start,end],[typeof window!==\"undefined\"?window.innerHeight:1e3,0]);const zIndex=index;const cardImage=card.image||{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Card Image\"};return /*#__PURE__*/_jsxs(motion.div,{style:{position:\"absolute\",width:cardWidth,minHeight:cardHeight===\"auto\"?\"auto\":cardHeight,height:cardHeight===\"auto\"?\"auto\":cardHeight,borderRadius,backgroundColor,padding,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:16,boxShadow:`${shadowX}px ${shadowY}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}`,y,zIndex,rotate:card.tilt},children:[/*#__PURE__*/_jsx(\"img\",{src:cardImage.src,alt:cardImage.alt,style:{width:\"100%\",height:cardHeight===\"auto\"?\"auto\":\"60%\",objectFit:\"cover\",borderRadius:borderRadius*.7}}),/*#__PURE__*/_jsx(\"p\",{style:{...font,color:textColor,margin:0,textAlign:\"center\"},children:card.text})]},index);})})});}addPropertyControls(StackingCards,{cards:{type:ControlType.Array,control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"Card Text\"},tilt:{type:ControlType.Number,title:\"Tilt\",defaultValue:0,min:-45,max:45,step:1,unit:\"deg\"}}},defaultValue:[{image:{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Card 1\"},text:\"Card 1\",tilt:0},{image:{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Card 2\"},text:\"Card 2\",tilt:0},{image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Card 3\"},text:\"Card 3\",tilt:0},{image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Card 4\"},text:\"Card 4\",tilt:0},{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Card 5\"},text:\"Card 5\",tilt:0}],maxCount:5},cardWidth:{type:ControlType.Number,title:\"Card Width\",defaultValue:400,min:200,max:800,step:10,unit:\"px\"},cardHeight:{type:ControlType.Number,title:\"Card Height\",defaultValue:500,min:200,max:800,step:10,unit:\"px\",displayStepper:true},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:16,min:0,max:100,step:1,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"22px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},shadowX:{type:ControlType.Number,title:\"Shadow X\",defaultValue:0,min:-50,max:50,step:1,unit:\"px\"},shadowY:{type:ControlType.Number,title:\"Shadow Y\",defaultValue:4,min:-50,max:50,step:1,unit:\"px\"},shadowBlur:{type:ControlType.Number,title:\"Shadow Blur\",defaultValue:10,min:0,max:100,step:1,unit:\"px\"},shadowSpread:{type:ControlType.Number,title:\"Shadow Spread\",defaultValue:0,min:-50,max:50,step:1,unit:\"px\"},shadowColor:{type:ControlType.Color,title:\"Shadow Color\",defaultValue:\"rgba(0, 0, 0, 0.1)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StackingCards\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"500\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StackingCards.map"],"mappings":"sRASG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,EAAE,CAAC,YAAU,aAAW,eAAa,UAAQ,kBAAgB,YAAU,OAAK,UAAQ,UAAQ,aAAW,eAAa,eAAa,EAAY,EAAaA,EAAO,KAAK,CAAO,EAAS,GAAqB,CAAM,CAAC,EAAgB,GAAoBC,EAAS,EAAE,CAAM,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAa,OAAO,CAAC,eAAe,UAAU,CAAC,CAAC,CAE0lB,OAFzlB,MAAc,CAAC,GAAU,IAAS,QAAa,EAAS,OAAO,IAAM,MAAiB,CAAC,GAAG,EAAa,QAAQ,CACvgB,IAAM,EADuhB,EAAO,aAClgB,EAAM,OAAO,GAAG,MAAoB,EAAmB,EAAY,CAAC,GAAkE,OAA9D,GAAc,CAAC,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAA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