{"version":3,"file":"Photo.CL5HT2ME.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/gn1PfTSZDaOZErx1nDFI/X8sf0Ni8yLO82cLPfX7X/Photo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{C,useFont}from\"https://framerusercontent.com/modules/cbMRVrUUIur5pqBJymJQ/DFZkrAdDZpFII6exxvRJ/Theme.js\";/**\n * Photo — an image slot with the Nexora motion built in.\n * Pick an image in \"Image\" (or paste a URL in \"Image URL\").\n * Zoom on hover, greyscale-until-hover and a gentle scroll parallax can be switched on or off.\n * The placeholder fill and caption font follow your styles (see Theme.tsx).\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Photo(props){const{image,src,alt,focus,radius,zoom,mono,parallax,caption,captionColor}=props;const font=useFont(\"Geist\");const url=image?.src||src;const box=useRef(null);const img=useRef(null);useEffect(()=>{if(!parallax||RenderTarget.current()===RenderTarget.canvas)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;let raf=0;const tick=()=>{raf=0;const b=box.current,i=img.current;if(!b||!i)return;const r=b.getBoundingClientRect();const vh=window.innerHeight;if(r.bottom<0||r.top>vh)return;i.style.transform=`translateY(${(-((r.top+r.height/2)/vh-.5)*6).toFixed(2)}%)`;};const on=()=>{if(!raf)raf=requestAnimationFrame(tick);};window.addEventListener(\"scroll\",on,{passive:true});tick();return()=>window.removeEventListener(\"scroll\",on);},[parallax]);const cls=`nx-photo${zoom?\" nx-z\":\"\"}${mono?\" nx-m\":\"\"}`;return /*#__PURE__*/_jsxs(\"div\",{ref:box,className:cls,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,background:C.card},children:[url&&/*#__PURE__*/_jsx(\"img\",{ref:img,src:url,srcSet:image?.srcSet,alt:alt||image?.alt||\"\",loading:\"lazy\",decoding:\"async\",style:{position:\"absolute\",left:0,top:parallax?\"-6%\":0,width:\"100%\",height:parallax?\"112%\":\"100%\",objectFit:\"cover\",objectPosition:focus,display:\"block\",transition:\"scale 1.2s cubic-bezier(.16,1,.3,1), filter .7s\",willChange:parallax?\"transform\":undefined}}),caption&&/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:18,bottom:16,zIndex:2,fontSize:13,color:captionColor,fontFamily:`\"${font}\", sans-serif`},children:caption}),/*#__PURE__*/_jsx(\"style\",{children:`.nx-z:hover img,[data-framer-name*=\"[card]\"]:hover .nx-z img{scale:1.045}.nx-m img{filter:grayscale(1)}.nx-m:hover img,[data-framer-name*=\"[card]\"]:hover .nx-m img{filter:none}`})]});}Photo.defaultProps={src:\"https://framerusercontent.com/images/uOvROiFOSwrh6hQ4dJtef1zNb4k.jpg\",alt:\"\",focus:\"50% 50%\",radius:8,zoom:true,mono:false,parallax:false,caption:\"\",captionColor:\"rgba(255,255,255,0.85)\",width:600,height:400};addPropertyControls(Photo,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},src:{type:ControlType.String,title:\"Image URL\",description:\"Used when no image is picked above.\"},alt:{type:ControlType.String,title:\"Alt text\"},focus:{type:ControlType.String,title:\"Focus\",defaultValue:\"50% 50%\",description:\"Object position, e.g. 50% 30%\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:60,unit:\"px\",defaultValue:8},zoom:{type:ControlType.Boolean,title:\"Hover zoom\",defaultValue:true},mono:{type:ControlType.Boolean,title:\"Greyscale\",defaultValue:false,description:\"Grey until hovered.\"},parallax:{type:ControlType.Boolean,title:\"Parallax\",defaultValue:false},caption:{type:ControlType.String,title:\"Caption\"},captionColor:{type:ControlType.Color,title:\"Caption colour\",defaultValue:\"rgba(255,255,255,0.85)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Photo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVers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