{"version":3,"file":"SwipeCardStack.B5I5xg1_.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/dAgRp3lr0TjmUvWXET6l/YfGQN4k6O09EF6L1NjmW/SwipeCardStack.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useReducedMotion}from\"framer-motion\";const defaultCards=[{image:{src:\"https://images.unsplash.com/photo-1739056238917-d89cd05c48d5?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85\",alt:\"Chrome sculpture study\"},label:\"01 / RESEARCH — FIND THE FRICTION\"},{image:{src:\"https://images.unsplash.com/photo-1784784760818-a014040d9003?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85\",alt:\"Abstract metallic waves\"},label:\"02 / FORM — BUILD THE LANGUAGE\"},{image:{src:\"https://images.unsplash.com/photo-1759179075678-d65678f1050e?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85\",alt:\"Purple metallic surface\"},label:\"03 / SYSTEM — MAKE IT HOLD\"}];/**\n * @framerIntrinsicWidth 432\n * @framerIntrinsicHeight 272\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SwipeCardStack(props){const{cards=defaultCards,accent=\"#FF3C23\",ink=\"#141412\",style}=props;const usableCards=cards.length>0?cards:defaultCards;const[order,setOrder]=useState(()=>usableCards.map((_,index)=>index));const[exitDirection,setExitDirection]=useState(0);const isStatic=useIsStaticRenderer();const shouldReduceMotion=useReducedMotion();const sendToBack=direction=>{if(exitDirection!==0||isStatic)return;setExitDirection(direction);const updateOrder=()=>{startTransition(()=>{setOrder(current=>[...current.slice(1),current[0]]);setExitDirection(0);});};if(shouldReduceMotion){updateOrder();}else if(typeof window!==\"undefined\"){window.setTimeout(updateOrder,260);}};return /*#__PURE__*/_jsx(\"section\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\",userSelect:\"none\",touchAction:\"pan-y\",cursor:isStatic?\"default\":\"grab\"},role:\"region\",tabIndex:isStatic?-1:0,onKeyDown:event=>{if(event.key===\"ArrowRight\"||event.key===\"ArrowLeft\"||event.key===\"Enter\"||event.key===\" \"){event.preventDefault();sendToBack(event.key===\"ArrowLeft\"?-1:1);}},\"aria-roledescription\":\"card carousel\",\"aria-label\":\"Interactive design process cards. Drag sideways or use the arrow keys to reveal the next card.\",children:order.map((cardIndex,stackIndex)=>{const item=usableCards[cardIndex]??defaultCards[cardIndex%defaultCards.length];const fallbackItem=defaultCards[cardIndex%defaultCards.length];const imageSrc=item.image?.src||fallbackItem.image?.src;const imageSrcSet=item.image?.srcSet||fallbackItem.image?.srcSet;const imageAlt=item.image?.alt||fallbackItem.image?.alt||\"\";const isTop=stackIndex===0;const depth=Math.min(stackIndex,2);const rotations=[-1.5,2.5,-3.5];const xOffsets=[0,10,19];const yOffsets=[0,9,17];return /*#__PURE__*/_jsxs(motion.article,{drag:isTop&&!isStatic?\"x\":false,dragConstraints:{left:0,right:0},dragElastic:.72,onDragEnd:(_,info)=>{if(Math.abs(info.offset.x)>72||Math.abs(info.velocity.x)>520){sendToBack(info.offset.x>=0?1:-1);}},animate:{x:isTop&&exitDirection!==0?exitDirection*520:xOffsets[depth],y:yOffsets[depth],rotate:rotations[depth],scale:1-depth*.045,opacity:isTop&&exitDirection!==0?0:1},transition:shouldReduceMotion?{duration:0}:{type:\"spring\",stiffness:360,damping:30},whileDrag:shouldReduceMotion?undefined:{scale:1.035,rotate:0,cursor:\"grabbing\"},style:{position:\"absolute\",inset:0,zIndex:usableCards.length-stackIndex,overflow:\"hidden\",border:`3px solid ${ink}`,background:ink,boxShadow:`${8+depth*2}px ${8+depth*2}px 0 ${ink}`,transformOrigin:\"50% 100%\"},role:\"group\",\"aria-label\":item.label??`Process card ${cardIndex+1}`,children:[/*#__PURE__*/_jsx(\"img\",{src:imageSrc,srcSet:imageSrcSet,alt:imageAlt,draggable:false,loading:stackIndex===0?\"eager\":\"lazy\",decoding:\"async\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:\"linear-gradient(180deg, transparent 46%, rgba(20,20,18,.88) 100%)\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:14,right:14,bottom:13,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",gap:12,color:\"#F2EFE6\",fontFamily:\"Inter, Arial, sans-serif\",fontSize:10,fontWeight:800,letterSpacing:\".035em\",lineHeight:1,pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"span\",{children:item.label??`PROCESS ${cardIndex+1}`}),/*#__PURE__*/_jsx(\"span\",{style:{color:accent},children:\"DRAG\"})]})]},cardIndex);})});}addPropertyControls(SwipeCardStack,{cards:{type:ControlType.Array,title:\"Cards\",maxCount:6,control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"PROCESS CARD\"}}},defaultValue:defaultCards},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#FF3C23\"},ink:{type:ControlType.Color,title:\"Ink\",defaultValue:\"#141412\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SwipeCardStack\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"432\",\"framerIntrinsicHeight\":\"272\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SwipeCardStack.map"],"mappings":"sQAKG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,EAAa,SAAO,UAAU,MAAI,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