{"version":3,"file":"PanImage.O2-7mU8e.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","p","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_B6PCHH0A","ControlType","useIsStaticRenderer","PanImage","props","isStatic","rootRef","layerRef","span","travel","from","direction","to","STYLE_ID","tag","KEYFRAMES","root","layer","pauseOffscreen","observer","entry","entries","duration","label","image","style","focusX","focusY","scrim","init_PanImage"],"sources":["https:/framerusercontent.com/modules/nFOggXfwsugPGjtoawk0/NMR5isR6KNaqVeeFnUNG/PanImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef}from\"react\";const STYLE_ID=\"raines-pan-image-keyframes\";const KEYFRAMES=\"@keyframes rainesPanX{from{transform:translate3d(var(--pan-a),0,0)}to{transform:translate3d(var(--pan-b),0,0)}}\";/**\n * Pan Image\n *\n * A full-bleed image that drifts across its frame on a timer, independent of\n * scroll position. Unlike ParallaxLayer — which reads its own on-screen position\n * and therefore only moves while its container travels — this keeps moving while\n * the section sits still.\n *\n * The image is oversized by `travel` on the pan axis so an edge can never come\n * into view. That upscales the source by (frame width + travel) / frame width,\n * so keep `travel` modest unless the source has resolution to spare.\n *\n * Motion is a CSS animation with `alternate`, so it eases back instead of\n * snapping. Honours prefers-reduced-motion.\n *\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PanImage(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"\"},direction=\"left\",travel=120,duration=24,pauseOffscreen=true,scrim=\"rgba(0, 0, 0, 0)\",focusX=50,focusY=50,style}=props;const isStatic=useIsStaticRenderer();const rootRef=useRef(null);const layerRef=useRef(null);const span=Math.max(0,Math.round(travel));// Panning left means the content slides toward negative x; the extra width\n// sits on the right, so the frame stays covered at the end of the travel.\nconst from=direction===\"left\"?\"0px\":`-${span}px`;const to=direction===\"left\"?`-${span}px`:\"0px\";useEffect(()=>{if(isStatic||typeof document===\"undefined\")return;if(document.getElementById(STYLE_ID))return;const tag=document.createElement(\"style\");tag.id=STYLE_ID;tag.textContent=KEYFRAMES;document.head.appendChild(tag);},[isStatic]);useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const root=rootRef.current;const layer=layerRef.current;if(!root||!layer)return;const reduced=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\");if(reduced?.matches){layer.style.animation=\"none\";layer.style.transform=\"translate3d(0,0,0)\";return;}if(!pauseOffscreen||typeof IntersectionObserver===\"undefined\")return;const observer=new IntersectionObserver(entries=>{for(const entry of entries){layer.style.animationPlayState=entry.isIntersecting?\"running\":\"paused\";}},{rootMargin:\"200px\"});observer.observe(root);return()=>observer.disconnect();},[isStatic,pauseOffscreen,span,duration,direction]);const label=image?.alt??\"\";return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:{...style,position:\"relative\",overflow:\"hidden\",width:style?.width??\"100%\",height:style?.height??\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:layerRef,role:label?\"img\":undefined,\"aria-label\":label||undefined,\"aria-hidden\":label?undefined:true,style:{position:\"absolute\",top:0,bottom:0,left:0,width:`calc(100% + ${span}px)`,backgroundImage:image?.src?`url(\"${image.src}\")`:undefined,backgroundSize:\"cover\",backgroundPosition:`${focusX}% ${focusY}%`,backgroundRepeat:\"no-repeat\",willChange:\"transform\",\"--pan-a\":from,\"--pan-b\":to,animation:isStatic?undefined:`rainesPanX ${Math.max(1,duration)}s ease-in-out infinite alternate`,transform:isStatic?`translate3d(${from}, 0, 0)`:undefined}}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{position:\"absolute\",inset:0,background:scrim,pointerEvents:\"none\"}})]});}addPropertyControls(PanImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"left\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],displaySegmentedControl:true},travel:{type:ControlType.Number,title:\"Travel\",defaultValue:120,min:0,max:400,step:10,unit:\"px\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:24,min:2,max:120,step:1,unit:\"s\"},pauseOffscreen:{type:ControlType.Boolean,title:\"Pause Off\",defaultValue:true},scrim:{type:ControlType.Color,title:\"Scrim\",defaultValue:\"rgba(0, 0, 0, 0)\"},focusX:{type:ControlType.Number,title:\"Focus X\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},focusY:{type:ControlType.Number,title:\"Focus Y\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PanImage\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"1200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PanImage.map"],"mappings":"A,8MAoBG,SAAwBc,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,EAAE,EAAE,YAAU,OAAO,SAAO,IAAI,WAAS,GAAG,iBAAe,GAAK,QAAM,mBAAmB,SAAO,GAAG,SAAO,GAAG,SAAOC,EAAYC,EAASH,EAAoB,EAAQI,EAAQjB,EAAO,IAAI,EAAQkB,EAASlB,EAAO,IAAI,EAAQmB,EAAK,KAAK,IAAI,EAAE,KAAK,MAAMC,CAAM,CAAC,EAE9XC,EAAKC,IAAY,OAAO,MAAM,IAAIH,EAAK,IAAUI,EAAGD,IAAY,OAAO,IAAIH,EAAK,IAAI,MAAMX,MAAc,CAAmD,GAA/CQ,GAAU,OAA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