{"version":3,"file":"ParallaxImage_prod.B--v7Pzt.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/zxcGfQb3lPhoJOWc1HTU/5PU3Q27oKjUYbpyx4J58/ParallaxImage_prod.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";import{useReducedMotion}from\"framer-motion\";const DEFAULT_IMAGE={src:\"https://framerusercontent.com/images/oHxPQbqbgpU7CA0wduhfDb4izBY.png\",alt:\"\"};const DEFAULT_RADIUS={top:0,right:0,bottom:0,left:0};function radiusValue(radius){if(typeof radius===\"number\"||typeof radius===\"string\")return radius;return`${radius?.top??0}px ${radius?.right??0}px ${radius?.bottom??0}px ${radius?.left??0}px`;}/** Skip style writes when transform delta is below this many pixels. */const TRANSFORM_EPSILON=.5;const sharedInstances=new Set;let sharedFrameId=null;let sharedListenersAttached=false;function sharedTick(){sharedFrameId=null;if(document.hidden)return;let needsContinuous=false;for(const instance of sharedInstances){if(!instance.active||!instance.intersecting)continue;instance.update();if(instance.continuous)needsContinuous=true;}if(needsContinuous){sharedFrameId=requestAnimationFrame(sharedTick);}}function requestSharedUpdate(){if(sharedFrameId===null&&!document.hidden&&sharedInstances.size>0){sharedFrameId=requestAnimationFrame(sharedTick);}}function handleSharedVisibility(){if(document.hidden){if(sharedFrameId!==null){cancelAnimationFrame(sharedFrameId);sharedFrameId=null;}}else{requestSharedUpdate();}}function attachSharedListeners(){if(sharedListenersAttached)return;sharedListenersAttached=true;window.addEventListener(\"scroll\",requestSharedUpdate,{passive:true});window.addEventListener(\"resize\",requestSharedUpdate,{passive:true});document.addEventListener(\"visibilitychange\",handleSharedVisibility);}function detachSharedListenersIfEmpty(){if(sharedInstances.size>0)return;if(!sharedListenersAttached)return;sharedListenersAttached=false;window.removeEventListener(\"scroll\",requestSharedUpdate);window.removeEventListener(\"resize\",requestSharedUpdate);document.removeEventListener(\"visibilitychange\",handleSharedVisibility);if(sharedFrameId!==null){cancelAnimationFrame(sharedFrameId);sharedFrameId=null;}}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n * @framerDisableUnlink\n */export default function ImageParallax(props){const{verticalParallaxAmount=30,horizontalParallaxAmount=0,image=DEFAULT_IMAGE,style,borderRadius=DEFAULT_RADIUS,border,boxShadow}=props;const containerRef=useRef(null);const imageRef=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const reducedMotion=useReducedMotion();useEffect(()=>{if(isCanvas)return;if(reducedMotion){if(imageRef.current){imageRef.current.style.transform=\"translate3d(0, 0, 0)\";imageRef.current.style.willChange=\"auto\";}return;}const container=containerRef.current?.isConnected?containerRef.current:null;const imageElement=imageRef.current;if(!container||!imageElement)return;let lastX=Number.NaN;let lastY=Number.NaN;let lastLeft=Number.NaN;let sleepTimer=null;const wantsContinuous=horizontalParallaxAmount!==0;/** While X≠0 is intersecting but stationary, poll this often so looping parents still wake without a window scroll. */const CONTINUOUS_SLEEP_MS=120;const clearSleepTimer=()=>{if(sleepTimer!==null){window.clearTimeout(sleepTimer);sleepTimer=null;}};const armSleepProbe=()=>{if(sleepTimer!==null)return;if(!instance.active||!instance.intersecting||document.hidden)return;sleepTimer=window.setTimeout(()=>{sleepTimer=null;// Force movement re-check on the next shared tick\nlastLeft=Number.NaN;requestSharedUpdate();},CONTINUOUS_SLEEP_MS);};const instance={active:true,intersecting:true,continuous:false,update:()=>{if(!instance.active||!instance.intersecting||document.hidden){instance.continuous=false;clearSleepTimer();return;}const rect=container.getBoundingClientRect();if(rect.width<=0||rect.height<=0){instance.continuous=false;clearSleepTimer();return;}const verticalProgress=Math.max(0,Math.min(1,(window.innerHeight-rect.top)/(window.innerHeight+rect.height)));const y=(verticalProgress-.5)*(verticalParallaxAmount/100)*rect.height;let x=0;if(wantsContinuous){const horizontalProgress=(rect.left+rect.width/2-window.innerWidth/2)/window.innerWidth;x=horizontalProgress*(horizontalParallaxAmount/100)*rect.width;// Sleep continuous rAF when stationary; probe infrequently\n// so looping parents that later move rect.left still wake.\n// Default X=0 never enters this branch.\nif(Number.isNaN(lastLeft)||Math.abs(rect.left-lastLeft)>=TRANSFORM_EPSILON){instance.continuous=true;lastLeft=rect.left;clearSleepTimer();}else{instance.continuous=false;armSleepProbe();}}else{instance.continuous=false;clearSleepTimer();}if(Number.isNaN(lastX)||Number.isNaN(lastY)||Math.abs(x-lastX)>=TRANSFORM_EPSILON||Math.abs(y-lastY)>=TRANSFORM_EPSILON){lastX=x;lastY=y;imageElement.style.transform=`translate3d(${x}px, ${y}px, 0)`;}}};const setWillChange=on=>{imageElement.style.willChange=on?\"transform\":\"auto\";};const intersectionObserver=new IntersectionObserver(([entry])=>{instance.intersecting=entry?entry.isIntersecting:true;if(instance.intersecting){setWillChange(true);// Wake from sleep when re-entering view\nlastLeft=Number.NaN;clearSleepTimer();requestSharedUpdate();}else{instance.continuous=false;clearSleepTimer();setWillChange(false);}},{rootMargin:\"100px\"});const resizeObserver=new ResizeObserver(()=>{// Size changes can move rect.left without a window scroll\nlastLeft=Number.NaN;requestSharedUpdate();});sharedInstances.add(instance);attachSharedListeners();setWillChange(true);intersectionObserver.observe(container);resizeObserver.observe(container);requestSharedUpdate();return()=>{instance.active=false;instance.continuous=false;clearSleepTimer();sharedInstances.delete(instance);detachSharedListenersIfEmpty();intersectionObserver.disconnect();resizeObserver.disconnect();imageElement.style.willChange=\"auto\";};},[verticalParallaxAmount,horizontalParallaxAmount,isCanvas,reducedMotion]);const{src:imageSrc,positionX,positionY,...imageAttributes}=typeof image===\"string\"?{src:image,positionX:undefined,positionY:undefined}:image;const imagePosition=positionX&&positionY?`${positionX} ${positionY}`:\"center\";const radius=radiusValue(borderRadius);return /*#__PURE__*/_jsxs(\"div\",{\"data-build\":\"parallax-image-prod-20260929-01\",ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",...style,overflow:\"hidden\",borderRadius:radius,boxShadow:boxShadow||undefined},children:[isCanvas?/*#__PURE__*/_jsx(\"img\",{...imageAttributes,src:imageSrc,alt:imageAttributes.alt??\"\",draggable:false,style:{width:\"100%\",height:\"100%\",display:\"block\",objectFit:\"cover\",objectPosition:imagePosition,borderRadius:radius,userSelect:\"none\",pointerEvents:\"none\"}}):/*#__PURE__*/_jsx(\"img\",{...imageAttributes,ref:imageRef,src:imageSrc,alt:imageAttributes.alt??\"\",draggable:false,style:{position:\"absolute\",top:`-${Math.abs(verticalParallaxAmount)/2}%`,left:`-${Math.abs(horizontalParallaxAmount)/2}%`,width:`calc(100% + ${Math.abs(horizontalParallaxAmount)}%)`,height:`calc(100% + ${Math.abs(verticalParallaxAmount)}%)`,objectFit:\"cover\",objectPosition:imagePosition,borderRadius:radius,// will-change set/cleared via IntersectionObserver\nbackfaceVisibility:\"hidden\",userSelect:\"none\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,zIndex:1,boxSizing:\"border-box\",borderRadius:radius,pointerEvents:\"none\",...border||{}}})]});}addPropertyControls(ImageParallax,{image:{type:ControlType.ResponsiveImage,title:\"Image\",[\"defaultValue\"]:DEFAULT_IMAGE},verticalParallaxAmount:{type:ControlType.Number,title:\"Parallax Y\",defaultValue:30,step:5,max:100,min:-100,unit:\"%\"},horizontalParallaxAmount:{type:ControlType.Number,title:\"Parallax X\",defaultValue:0,step:5,max:100,min:-100,unit:\"%\"},border:{type:ControlType.Border,title:\"Border\",optional:true},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:DEFAULT_RADIUS,min:0,max:100,step:1,unit:\"px\"},boxShadow:{type:ControlType.BoxShadow,title:\"Shadow\",description:\"More components at [Framer University](https://frameruni.link/cc).\"}});ImageParallax.displayName=\"Image Parallax\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageParallax\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"300\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ParallaxImage_prod.map"],"mappings":"oPAAuW,SAAS,EAAY,EAAO,CAAqE,OAAjE,OAAO,GAAS,UAAU,OAAO,GAAS,SAAgB,EAAa,GAAG,GAAQ,KAAK,EAAE,KAAK,GAAQ,OAAO,EAAE,KAAK,GAAQ,QAAQ,EAAE,KAAK,GAAQ,MAAM,EAAE,GAAI,CAA2L,SAAS,GAAY,CAAoB,GAAnB,EAAc,KAAQ,SAAS,OAAO,OAAO,IAAI,EAAgB,GAAM,IAAI,IAAM,KAAY,EAAoB,CAAC,EAAS,QAAQ,CAAC,EAAS,eAAsB,EAAS,OAAO,EAAK,EAAS,aAAW,EAAgB,KAAS,IAAiB,EAAc,sBAAsB,CAAU,EAAG,CAAC,SAAS,GAAqB,CAAI,IAAgB,MAAM,CAAC,SAAS,QAAQ,EAAgB,KAAK,IAAG,EAAc,sBAAsB,CAAU,EAAG,CAAC,SAAS,GAAwB,CAAI,SAAS,OAAW,IAAgB,OAAM,qBAAqB,CAAa,EAAE,EAAc,MAAY,EAAoB,CAAG,CAAC,SAAS,GAAuB,CAAI,IAA+B,EAAwB,GAAK,EAAO,iBAAiB,SAAS,EAAoB,CAAC,QAAQ,EAAI,CAAC,EAAE,EAAO,iBAAiB,SAAS,EAAoB,CAAC,QAAQ,EAAI,CAAC,EAAE,SAAS,iBAAiB,mBAAmB,CAAsB,EAAE,CAAC,SAAS,GAA8B,CAAI,EAAgB,KAAK,GAAa,IAA+B,EAAwB,GAAM,EAAO,oBAAoB,SAAS,CAAmB,EAAE,EAAO,oBAAoB,SAAS,CAAmB,EAAE,SAAS,oBAAoB,mBAAmB,CAAsB,EAAK,IAAgB,OAA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