{"version":3,"file":"PhotoStack.CwjCUDtZ.mjs","names":["useRef","useCallback","__esmMin","ne","init_npm_react_18_3_1","window","ce","init_jsx_runtime","J","de","init_ssg_sandbox_shims","fadeShadow","shadow","r","g","b","k","assignRef","ref","value","getParts","photos","root","num","el","a","photo","paint","n","parts","v","shown","i","drop","clamp","POP_SCALE","POP_ROTATE","SLIDE","overlay","newer","j","lo","LEVELS","hi","f","level","render","easeOut","progress","dropAt","FIRST_DELAY","STEP","POP","makeStack","node","setRef","wrap","box","saved","fit","DESIGN_WIDTH","MAX_GROW","DESKTOP_MIN","BASE_W","BASE_H","stopFit","mode","raf","playing","done","io","entry","t0","total","dropDuration","tick","elapsed","track","update","vh","p","pin","top","h","onScroll","Component","props","withStackOnAppear","withGradientText","init_PhotoStack","max","min","t"],"sources":["https:/framerusercontent.com/modules/zVN8X2VAKDodJGutC7hT/gbDag4u1vGwrF9ydvnIK/PhotoStack.js"],"sourcesContent":["// Photo stack overrides for the Careers \"We make it happen.\" section.\n// The photos are normal Framer frames named \"Photo 1\"…\"Photo 4\" (bottom → top),\n// each with a white child frame named \"Overlay\". The canvas shows the final\n// state; these overrides animate it on the live site:\n//   withStackOnScroll       – tied to scrolling past the section\n//   withStackOnScrollPinned – tied to scrolling while the section is pinned (sticky)\n//   withStackOnAppear       – photo 1 in place, the rest drop onto the pile when the\n//                             section comes into view (again on every return)\n// Each new photo fades/slides in on top; older photos get a stronger white\n// overlay (0 → 50% → 70% → 90%) so they stay opaque where they overlap.\n// withGradientText adds the pink → blue gradient to a normal text layer.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";const LEVELS=[0,.5,.7,.9];// \"On appear\" timing (Ramp-style drop): photo 1 is already in place, then after a\n// short pause the others drop onto the pile in quick succession.\nconst FIRST_DELAY=450// ms before photo 2 drops\n;const STEP=170// ms between drops\n;const POP=260// ms for one photo to settle\n;const POP_SCALE=.08// a dropping photo starts 8% bigger…\n;const POP_ROTATE=4// …and tilted a few degrees extra (alternating)\n;const SLIDE=48// px each photo travels up while appearing\n;// Wide screens: above the design width the photos grow with the section\nconst DESKTOP_MIN=1232// desktop breakpoint\n;const DESIGN_WIDTH=1088// section container width in Figma\n;const MAX_GROW=1.4// photos at most 40% bigger\n;const BASE_W=480// \"Photos\" frame size at the design width\n;const BASE_H=461;// Scales the strength (alpha) of every colour in a CSS box-shadow, keeping\n// the offsets/blur from Framer. Used so washed-out photos also lose their shadow.\nfunction fadeShadow(shadow,k){if(!shadow||shadow===\"none\")return shadow;return shadow.replace(/rgba?\\(([^,]+),([^,]+),([^,)]+)(?:,([^)]+))?\\)/g,(_m,r,g,b,a)=>`rgba(${r},${g},${b},${(a===undefined?1:parseFloat(a))*k})`);}const clamp=(v,min=0,max=1)=>Math.min(max,Math.max(min,v));const easeOut=t=>1-Math.pow(1-t,3);function assignRef(ref,value){if(!ref)return;if(typeof ref===\"function\")ref(value);else ref.current=value;}function getParts(root){const photos=Array.from(root.querySelectorAll('[data-framer-name^=\"Photo \"]'));const num=el=>parseInt((el.getAttribute(\"data-framer-name\")||\"\").replace(/\\D/g,\"\"),10)||0;photos.sort((a,b)=>num(a)-num(b));return photos.map(photo=>({photo,overlay:photo.querySelector('[data-framer-name=\"Overlay\"]'),// the shadow set in Framer, read once before we touch anything\n    shadow:getComputedStyle(photo).boxShadow}));}// shown[i]: 0 = photo i not there yet, 1 = settled on the pile\nfunction paint(parts,shown,drop){const n=parts.length;parts.forEach(({photo,overlay,shadow},i)=>{const v=shown[i];// individual translate/scale/rotate keep Framer's own rotation intact\nif(drop){photo.style.opacity=String(clamp(v/.4));photo.style.translate=\"0px 0px\";photo.style.scale=String(1+POP_SCALE*(1-v));photo.style.rotate=`${(i%2?-1:1)*POP_ROTATE*(1-v)}deg`;}else{photo.style.opacity=String(v);photo.style.translate=`0px ${(1-v)*SLIDE}px`;photo.style.scale=String(.94+.06*v);}if(overlay){let newer=0;for(let j=i+1;j<n;j++)newer+=shown[j];const lo=Math.min(Math.floor(newer),LEVELS.length-1);const hi=Math.min(lo+1,LEVELS.length-1);const f=newer-Math.floor(newer);const level=LEVELS[lo]+(LEVELS[hi]-LEVELS[lo])*f;overlay.style.opacity=String(level);// the shadow washes out together with the photo (90% white → 10% shadow)\nphoto.style.boxShadow=fadeShadow(shadow,1-level);}});}// scroll modes: progress 0 → 1 runs through all photos in order\nfunction render(parts,progress){const n=parts.length;paint(parts,parts.map((_,i)=>easeOut(clamp(progress*n-i))),false);}// appear mode: t = ms since the animation started\nfunction dropAt(parts,t){paint(parts,parts.map((_,i)=>i===0?1:easeOut(clamp((t-FIRST_DELAY-(i-1)*STEP)/POP))),true);}const dropDuration=n=>FIRST_DELAY+Math.max(0,n-2)*STEP+POP;function makeStack(mode){return Component=>/*#__PURE__*/forwardRef((props,ref)=>{const node=useRef(null);const setRef=useCallback(el=>{node.current=el;assignRef(ref,el);},[ref]);useEffect(()=>{const root=node.current;if(!root||typeof window===\"undefined\")return;const parts=getParts(root);if(!parts.length)return;// Wide screens: scale the stack with the section and grow the \"Photos\"\n    // frame with it, so the section gets taller too (desktop only).\n    // find the frames by name: Framer can add wrapper elements in between\n    const wrap=root.closest('[data-framer-name=\"Photos\"]');const box=root.closest('[data-framer-name=\"Section container\"]');let saved=null;const fit=()=>{if(!wrap||!box)return;const f=clamp(box.clientWidth/DESIGN_WIDTH,1,MAX_GROW);// only on desktop screens wider than the design; tablet/phone keep their own size\n    if(window.innerWidth<DESKTOP_MIN||f<=1.01){if(saved){root.style.scale=saved.scale;wrap.style.width=saved.w;wrap.style.height=saved.h;saved=null;}return;}if(!saved)saved={scale:root.style.scale,w:wrap.style.width,h:wrap.style.height};root.style.scale=String(f);wrap.style.width=`${BASE_W*f}px`;wrap.style.height=`${BASE_H*f}px`;};fit();window.addEventListener(\"resize\",fit);const stopFit=()=>window.removeEventListener(\"resize\",fit);if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches){render(parts,1);return stopFit;}if(mode===\"appear\")dropAt(parts,0);else render(parts,0);if(mode===\"appear\"){// Plays when 40% of the stack is visible; resets once it has fully\n    // left the screen, so it plays again every time you come back.\n    let raf=0;let playing=false;let done=false;const io=new IntersectionObserver(([entry])=>{if(!entry.isIntersecting){cancelAnimationFrame(raf);playing=false;done=false;dropAt(parts,0);return;}if(entry.intersectionRatio<.4||playing||done)return;playing=true;let t0=0;const total=dropDuration(parts.length);const tick=t=>{if(!t0)t0=t;const elapsed=t-t0;dropAt(parts,elapsed);if(elapsed<total)raf=requestAnimationFrame(tick);else{playing=false;done=true;}};raf=requestAnimationFrame(tick);},{threshold:[0,.4]});io.observe(root);return()=>{io.disconnect();cancelAnimationFrame(raf);stopFit();};}// scroll modes: progress follows the surrounding <section>\n    const track=root.closest(\"section\")||root;let raf=0;const update=()=>{raf=0;const r=track.getBoundingClientRect();const vh=window.innerHeight;let p;if(mode===\"pinned\"){// from the moment it pins until the pin releases\n    let pin=root;while(pin&&pin!==track&&getComputedStyle(pin).position!==\"sticky\")pin=pin.parentElement;const top=pin?parseFloat(getComputedStyle(pin).top)||0:0;const h=pin&&pin!==track?pin.offsetHeight:vh;p=(top-r.top)/Math.max(1,r.height-h);}else{// from section top at 80% of the screen until its bottom reaches the screen bottom\n    p=(vh*.8-r.top)/Math.max(200,r.height-vh*.2);}render(parts,clamp(p));};const onScroll=()=>{if(!raf)raf=requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{cancelAnimationFrame(raf);window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);stopFit();};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:setRef});});}// Framer only detects overrides declared as exported functions\nexport function withStackOnScroll(Component){return makeStack(\"scroll\")(Component);}export function withStackOnScrollPinned(Component){return makeStack(\"pinned\")(Component);}export function withStackOnAppear(Component){return makeStack(\"appear\")(Component);}export function withGradientText(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,backgroundImage:\"linear-gradient(90deg, #F145FF 0%, #000BDD 100%)\",WebkitBackgroundClip:\"text\",backgroundClip:\"text\",WebkitTextFillColor:\"transparent\"}}));}\nexport const __FramerMetadata__ = {\"exports\":{\"withStackOnScrollPinned\":{\"type\":\"reactHoc\",\"name\":\"withStackOnScrollPinned\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStackOnAppear\":{\"type\":\"reactHoc\",\"name\":\"withStackOnAppear\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStackOnScroll\":{\"type\":\"reactHoc\",\"name\":\"withStackOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGradientText\":{\"type\":\"reactHoc\",\"name\":\"withGradientText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhotoStack.map"],"mappings":"A,gJA0BA,SAASW,EAAW,EAAO,EAAE,CAA2C,MAAvC,CAACC,GAAQA,IAAS,OAAcA,EAAcA,EAAO,QAAQ,mDAAmD,EAAG,EAAE,EAAE,EAAE,IAAI,QAAQC,EAAE,GAAGC,EAAE,GAAGC,EAAE,IAAI,IAAI,IAAA,GAAU,EAAE,WAAW,CAAC,GAAGC,EAAE,EAAE,CAAE,CAA+F,SAASC,EAAU,EAAI,EAAM,CAAKC,IAAc,OAAOA,GAAM,WAAWA,EAAIC,CAAK,EAAO,EAAI,QAAQA,EAAM,CAAC,SAASC,EAAS,EAAK,CAAC,IAAMC,EAAO,MAAM,KAAKC,EAAK,iBAAiB,8BAA8B,CAAC,EAAQC,EAAI,GAAI,UAAUC,EAAG,aAAa,kBAAkB,GAAG,GAAA,CAAI,QAAQ,MAAM,EAAE,EAAE,EAAE,GAAG,EAAoC,OAAlCH,EAAO,MAAM,EAAE,IAAIE,EAAIE,CAAC,EAAEF,EAAIR,CAAC,CAAC,EAASM,EAAO,IAAI,IAAQ,CAAC,QAAM,QAAQK,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