{"version":3,"file":"shared-lib.DIPC0Hd9.mjs","names":["useRef","useState","__esmMin","le","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","Ha","p","c","init_jsx_runtime","ce","window","useAnimation","init_framer_motion_DhsWWWsN","motion","addPropertyControls","RenderTarget","init_framer_CKT6jEEQ","ControlType","StackedCardsTransition","isCanvas","c1","c2","c3","portalEl","portalReady","setPortalReady","navigating","allowNextClick","isCovering","reducedMotion","startCovered","SESSION_KEY","isTransitionRef","posOffIn","direction","posCenter","posOffOut","el","runEnter","r","out","cardTransition","stagger","handleClick","anchor","href","parsedUrl","runExit","center","fallbackMs","cardBase","initialPos","card1Color","card2Color","card3Color","init_Stacked_Card_Transition","init_npm_react_dom_18_3_1"],"sources":["https:/framerusercontent.com/modules/njoUdBKVBTnzDo7nxQ4q/vaGBrrWJlvTbRp4Kj9WV/Stacked_Card_Transition.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";import{motion,useAnimation}from\"framer-motion\";const SESSION_KEY=\"pt_wipe_active\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StackedCardsTransition({direction=\"vertical\",card1Color=\"#0f0f0f\",card2Color=\"#e85d2f\",card3Color=\"#f0e0d0\",cardTransition={type:\"tween\",duration:.7,ease:[.76,0,.24,1]},stagger=90}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const c1=useAnimation();const c2=useAnimation();const c3=useAnimation();const portalEl=useRef(null);const[portalReady,setPortalReady]=useState(false);const navigating=useRef(false);const allowNextClick=useRef(false);// Tracks whether cards are currently covering the screen.\n// Used by the fallback timer to auto-sweep cards out if the enter\n// animation never fires (e.g. same-page click in Framer Preview).\nconst isCovering=useRef(false);const reducedMotion=typeof window!==\"undefined\"?window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches:false;// Read sessionStorage synchronously on first render — before any paint.\n// This is the key fix: cards are invisible on cold load, covering on enter.\nconst[startCovered]=useState(()=>{if(typeof window===\"undefined\"||isCanvas)return false;return sessionStorage.getItem(SESSION_KEY)===\"true\";});const isTransitionRef=useRef(startCovered);function posOffIn(){return direction===\"horizontal\"?{x:\"100%\",y:\"0%\"}:{x:\"0%\",y:\"100%\"};}function posCenter(){return{x:\"0%\",y:\"0%\"};}function posOffOut(){return direction===\"horizontal\"?{x:\"-100%\",y:\"0%\"}:{x:\"0%\",y:\"-100%\"};}// ─── PORTAL SETUP ─────────────────────────────────────────────────────\nuseLayoutEffect(()=>{if(isCanvas)return;if(startCovered)sessionStorage.removeItem(SESSION_KEY);const el=document.createElement(\"div\");el.setAttribute(\"data-pt-wipe-portal\",\"\");document.body.appendChild(el);portalEl.current=el;setPortalReady(true);return()=>{document.body.removeChild(el);portalEl.current=null;};},[]);// ─── ENTER ANIMATION ──────────────────────────────────────────────────\nuseEffect(()=>{if(isCanvas||!portalReady||!isTransitionRef.current)return;async function runEnter(){// Real navigation happened — disarm the fallback timer\nisCovering.current=false;if(reducedMotion){c1.set(posOffOut());c2.set(posOffOut());c3.set(posOffOut());return;}await new Promise(r=>setTimeout(r,160));const out=posOffOut();c3.start({...out,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));c2.start({...out,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));await c1.start({...out,transition:cardTransition});}runEnter();},[portalReady]);// ─── EXIT ANIMATION ───────────────────────────────────────────────────\nuseEffect(()=>{if(isCanvas)return;const handleClick=e=>{const anchor=e.target.closest(\"a[href]\");if(!anchor)return;if(allowNextClick.current){allowNextClick.current=false;return;}if(navigating.current){e.preventDefault();return;}const href=anchor.getAttribute(\"href\");if(!href)return;if(href.startsWith(\"#\")||href.startsWith(\"mailto:\")||href.startsWith(\"tel:\")||href.startsWith(\"javascript:\"))return;let parsedUrl;try{parsedUrl=new URL(href,window.location.href);if(parsedUrl.hostname!==window.location.hostname)return;}catch{return;}// Same-page link — skip entirely so cards never get stuck\nif(parsedUrl.pathname===window.location.pathname)return;e.preventDefault();e.stopPropagation();navigating.current=true;async function runExit(){if(reducedMotion){sessionStorage.setItem(SESSION_KEY,\"true\");allowNextClick.current=true;navigating.current=false;anchor.click();return;}c1.set(posOffIn());c2.set(posOffIn());c3.set(posOffIn());const center=posCenter();c1.start({...center,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));c2.start({...center,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));await c3.start({...center,transition:cardTransition});sessionStorage.setItem(SESSION_KEY,\"true\");isCovering.current=true;allowNextClick.current=true;navigating.current=false;anchor.click();// ── Fallback timer ───────────────────────────────────────\n// If the page doesn't navigate (e.g. same-page link in\n// Framer Preview), the enter animation never runs and cards\n// stay stuck. After a generous timeout we sweep them out\n// ourselves and reset all state so the user isn't locked out.\nconst dur=cardTransition.duration??.7;const fallbackMs=dur*1e3*1.5+stagger*2+600;setTimeout(async()=>{if(!isCovering.current)return;// enter already handled it\nisCovering.current=false;navigating.current=false;sessionStorage.removeItem(SESSION_KEY);const out=posOffOut();c3.start({...out,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));c2.start({...out,transition:cardTransition});await new Promise(r=>setTimeout(r,stagger));await c1.start({...out,transition:cardTransition});},fallbackMs);}runExit();};document.addEventListener(\"click\",handleClick,true);return()=>document.removeEventListener(\"click\",handleClick,true);},[direction,cardTransition,stagger]);// ─── CANVAS PREVIEW ───────────────────────────────────────────────────\nif(isCanvas)return /*#__PURE__*/_jsx(\"div\",{style:{width:0,height:0,overflow:\"hidden\"}});// ─── LIVE OVERLAY (via portal) ────────────────────────────────────────\nif(!portalReady||!portalEl.current)return null;const cardBase={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\"};const initialPos=startCovered?posCenter():posOffIn();return /*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",inset:0,zIndex:9999,pointerEvents:\"none\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(motion.div,{animate:c1,initial:initialPos,style:{...cardBase,backgroundColor:card1Color}}),/*#__PURE__*/_jsx(motion.div,{animate:c2,initial:initialPos,style:{...cardBase,backgroundColor:card2Color}}),/*#__PURE__*/_jsx(motion.div,{animate:c3,initial:initialPos,style:{...cardBase,backgroundColor:card3Color}})]}),portalEl.current);}// ─── PROPERTY CONTROLS ───────────────────────────────────────────────────────\naddPropertyControls(StackedCardsTransition,{direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\"],optionTitles:[\"↓ Vertical\",\"→ Horizontal\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},card1Color:{type:ControlType.Color,title:\"Card 1\",defaultValue:\"#0f0f0f\"},card2Color:{type:ControlType.Color,title:\"Card 2\",defaultValue:\"#e85d2f\"},card3Color:{type:ControlType.Color,title:\"Card 3\",defaultValue:\"#f0e0d0\"},cardTransition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"tween\",duration:.7,ease:[.76,0,.24,1]}},stagger:{type:ControlType.Number,title:\"Stagger\",defaultValue:90,min:0,max:400,step:10,unit:\"ms\",displayStepper:true,description:\"Setup: Add this component to every page in your project. Keep all properties identical across pages for seamless transitions. Set Page Settings → Transitions to None (Instant). Note: transitions only fire on elements using the <a> tag — in Framer set this under Accessibility → Tag on your link layers.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StackedCardsTransition\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Stacked_Card_Transition.map"],"mappings":"A,6RAGG,SAAwBqB,EAAuB,CAAC,YAAU,WAAW,aAAW,UAAU,aAAW,UAAU,aAAW,UAAU,iBAAe,CAAC,KAAK,QAAQ,SAAS,GAAG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