{"version":3,"file":"Component.DGRjcH8A.mjs","names":["useRef","useState","useCallback","_Fragment","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","l","_e","p","init_jsx_runtime","ce","de","init_framer_DcxuU94H","addPropertyControls","ControlType","HoverInspectImage","props","frameRef","animationTimeoutRef","lens","setLens","isTouchFirst","setIsTouchFirst","shouldAnimateLens","setShouldAnimateLens","animateNextLensMove","updateLens","frame","rect","width","lensSizePercent","height","targetX","clientX","targetY","clientY","clamp","media","handleChange","handleResize","lensTop","lensRight","lensBottom","lensLeft","clipPathTransition","POSITION_TRANSITION","guidePositionTransition","guideLines","handlePointerMove","event","handlePointerEnter","handlePointerLeave","handlePointerDown","handleKeyDown","step","next","style","caption","overlayColor","line","GUIDE_LINE_COLOR","index","accentColor","init_Component","max","min","value"],"sources":["https:/framerusercontent.com/modules/tFehh6KaOFhlAtJ5bTww/F0Rqt8RAh8l1voCjrlwh/Component.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useCallback,useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const clamp=(value,min,max)=>Math.min(max,Math.max(min,value));const GUIDE_LINE_COLOR=\"rgba(122, 70, 255, 0.2)\";const POSITION_TRANSITION=\"220ms cubic-bezier(0.22, 1, 0.36, 1)\";/**\n * Hover-to-reveal image inspection card.\n *\n * @framerIntrinsicWidth 960\n * @framerIntrinsicHeight 540\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function HoverInspectImage(props){const{src=\"/images/cursor-2.png\",alt=\"Cursor showing button.tsx implementation\",caption=\"The design file showed the states. The code revealed the rules behind them.\",overlayColor=\"rgba(8, 4, 22, 0.72)\",accentColor=\"#08e683\",lensSizePercent=.25,aspectRatio=1.777,style}=props;const frameRef=useRef(null);const animationTimeoutRef=useRef();const[lens,setLens]=useState({x:480,y:270,width:240,height:136,frameWidth:960,frameHeight:540});const[isTouchFirst,setIsTouchFirst]=useState(false);const[shouldAnimateLens,setShouldAnimateLens]=useState(false);const animateNextLensMove=useCallback(()=>{setShouldAnimateLens(true);if(animationTimeoutRef.current){window.clearTimeout(animationTimeoutRef.current);}animationTimeoutRef.current=window.setTimeout(()=>{setShouldAnimateLens(false);},240);},[]);const updateLens=useCallback((clientX,clientY)=>{const frame=frameRef.current;if(!frame)return;const rect=frame.getBoundingClientRect();const width=Math.min(Math.max(72,rect.width*lensSizePercent),rect.width-24);const height=Math.min(Math.max(48,width*.58),rect.height-24);const targetX=typeof clientX===\"number\"?clientX-rect.left:rect.width/2;const targetY=typeof clientY===\"number\"?clientY-rect.top:rect.height/2;setLens({x:clamp(targetX,width/2+12,rect.width-width/2-12),y:clamp(targetY,height/2+12,rect.height-height/2-12),width,height,frameWidth:rect.width,frameHeight:rect.height});},[lensSizePercent]);useEffect(()=>{const media=window.matchMedia(\"(hover: none), (pointer: coarse)\");setIsTouchFirst(media.matches);updateLens();const handleChange=()=>setIsTouchFirst(media.matches);const handleResize=()=>updateLens();if(media.addEventListener){media.addEventListener(\"change\",handleChange);}else{media.addListener(handleChange);}window.addEventListener(\"resize\",handleResize);return()=>{if(animationTimeoutRef.current){window.clearTimeout(animationTimeoutRef.current);}if(media.removeEventListener){media.removeEventListener(\"change\",handleChange);}else{media.removeListener(handleChange);}window.removeEventListener(\"resize\",handleResize);};},[updateLens]);const lensTop=lens.y-lens.height/2;const lensRight=lens.frameWidth-(lens.x+lens.width/2);const lensBottom=lens.frameHeight-(lens.y+lens.height/2);const lensLeft=lens.x-lens.width/2;const clipPathTransition=shouldAnimateLens?`clip-path ${POSITION_TRANSITION}`:\"none\";const guidePositionTransition=shouldAnimateLens?POSITION_TRANSITION:null;const guideLines=[{left:lensLeft,top:0,width:1,height:\"100%\",transition:guidePositionTransition?`left ${guidePositionTransition}`:\"none\"},{left:lens.x+lens.width/2,top:0,width:1,height:\"100%\",transition:guidePositionTransition?`left ${guidePositionTransition}`:\"none\"},{left:0,top:lensTop,width:\"100%\",height:1,transition:guidePositionTransition?`top ${guidePositionTransition}`:\"none\"},{left:0,top:lens.y+lens.height/2,width:\"100%\",height:1,transition:guidePositionTransition?`top ${guidePositionTransition}`:\"none\"}];const handlePointerMove=event=>{if(event.pointerType===\"touch\")return;if(animationTimeoutRef.current){window.clearTimeout(animationTimeoutRef.current);}setShouldAnimateLens(false);updateLens(event.clientX,event.clientY);};const handlePointerEnter=event=>{if(event.pointerType===\"touch\")return;animateNextLensMove();updateLens(event.clientX,event.clientY);};const handlePointerLeave=event=>{if(event.pointerType===\"touch\")return;animateNextLensMove();updateLens();};const handlePointerDown=event=>{if(event.pointerType!==\"touch\")return;setIsTouchFirst(true);updateLens(event.clientX,event.clientY);};const handleKeyDown=event=>{const step=event.shiftKey?42:18;const next={...lens};if(event.key===\"ArrowLeft\")next.x-=step;else if(event.key===\"ArrowRight\")next.x+=step;else if(event.key===\"ArrowUp\")next.y-=step;else if(event.key===\"ArrowDown\")next.y+=step;else return;event.preventDefault();const frame=frameRef.current;if(!frame)return;setLens({...next,x:clamp(next.x,next.width/2+12,frame.clientWidth-next.width/2-12),y:clamp(next.y,next.height/2+12,frame.clientHeight-next.height/2-12),frameWidth:frame.clientWidth,frameHeight:frame.clientHeight});};return /*#__PURE__*/_jsxs(\"figure\",{style:{...style,display:\"block\",margin:0,width:\"100%\",height:\"100%\",lineHeight:0},children:[/*#__PURE__*/_jsxs(\"div\",{ref:frameRef,className:\"hover-inspect-frame\",role:\"group\",tabIndex:0,\"aria-label\":caption,onFocus:()=>updateLens(),onKeyDown:handleKeyDown,onPointerDown:handlePointerDown,onPointerEnter:handlePointerEnter,onPointerLeave:handlePointerLeave,onPointerMove:handlePointerMove,style:{position:\"relative\",width:\"100%\",aspectRatio,overflow:\"hidden\",isolation:\"isolate\",background:\"transparent\",cursor:isTouchFirst?\"default\":\"crosshair\",outline:\"none\"},children:[/*#__PURE__*/_jsx(\"img\",{src:src,alt:alt,draggable:false,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:isTouchFirst?1:.8,filter:isTouchFirst?\"none\":\"blur(3px) saturate(0.78)\",transform:\"scale(1.01)\",transition:\"filter 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms cubic-bezier(0.22, 1, 0.36, 1)\"}}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,background:overlayColor,opacity:isTouchFirst?0:1,transition:\"opacity 180ms cubic-bezier(0.22, 1, 0.36, 1)\"}}),!isTouchFirst&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:src,alt:\"\",\"aria-hidden\":\"true\",draggable:false,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",transform:\"scale(1.01)\",clipPath:`inset(${lensTop}px ${lensRight}px ${lensBottom}px ${lensLeft}px)`,transition:clipPathTransition,pointerEvents:\"none\"}}),guideLines.map((line,index)=>/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...line,position:\"absolute\",background:GUIDE_LINE_COLOR,pointerEvents:\"none\"}},index))]})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                .hover-inspect-frame:focus-visible {\n                    outline: 2px solid ${accentColor};\n                    outline-offset: 4px;\n                }\n\n                @media (prefers-reduced-motion: reduce) {\n                    .hover-inspect-frame * {\n                        transition: none !important;\n                        animation: none !important;\n                    }\n                }\n            `})]});}addPropertyControls(HoverInspectImage,{src:{type:ControlType.Image,title:\"Image\"},alt:{type:ControlType.String,title:\"Alt\",defaultValue:\"Cursor showing button.tsx implementation\"},caption:{type:ControlType.String,title:\"Caption\",defaultValue:\"The design file showed the states. The code revealed the rules behind them.\"},overlayColor:{type:ControlType.Color,title:\"Overlay\",defaultValue:\"rgba(8, 4, 22, 0.72)\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#08e683\"},lensSizePercent:{type:ControlType.Number,title:\"Lens %\",defaultValue:.25,min:.12,max:.5,step:.01},aspectRatio:{type:ControlType.Number,title:\"Aspect\",defaultValue:1.777,min:1,max:2.4,step:.001}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverInspectImage\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"960\",\"framerIntrinsicHeight\":\"540\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Component.map"],"mappings":"A,2NAQG,SAAwBkB,EAAkB,EAAM,CAAC,GAAK,CAAC,MAAI,uBAAuB,MAAI,2CAA2C,UAAQ,8EAA8E,eAAa,uBAAuB,cAAY,UAAU,kBAAgB,IAAI,cAAY,MAAM,SAAOC,EAAYC,EAASpB,EAAO,IAAI,EAAQqB,EAAoBrB,EAAO,EAAO,CAACsB,EAAKC,GAAStB,EAAS,CAAC,EAAE,IAAI,EAAE,IAAI,MAAM,IAAI,OAAO,IAAI,WAAW,IAAI,YAAY,GAAG,CAAC,EAAO,CAACuB,EAAaC,GAAiBxB,EAAS,EAAK,EAAO,CAACyB,EAAkBC,GAAsB1B,EAAS,EAAK,EAAQ2B,EAAoB1B,MAAgB,CAACyB,EAAqB,EAAI,EAAKN,EAAoB,SAASb,EAAO,aAAaa,EAAoB,OAAO,EAAG,EAAoB,QAAQb,EAAO,eAAe,CAACmB,EAAqB,EAAK,CAAE,EAAE,GAAG,CAAE,EAAE,CAAC,CAAC,EAAQE,EAAW3B,GAAa,EAAQ,IAAU,CAAC,IAAM4B,EAAMV,EAAS,QAAQ,GAAG,CAACU,EAAM,OAAO,IAAMC,EAAKD,EAAM,sBAAsB,EAAQE,EAAM,KAAK,IAAI,KAAK,IAAI,GAAGD,EAAK,MAAME,CAAe,EAAEF,EAAK,MAAM,EAAE,EAAQG,EAAO,KAAK,IAAI,KAAK,IA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