{"version":3,"file":"OriginButton.CKQLlAwz.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/PTLKSCZSj8qsHQ3vTrWx/Iz25mViOs1dHwRl116QG/OriginButton.js"],"sourcesContent":["// Rectangle with expanding circle on hover from cursor position\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{motion,useMotionValue,useSpring,useTransform}from\"framer-motion\";import{useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerDisableUnlink\n */export default function OriginButton(props){const{rectangleColor,circleColor}=props;const[isHovered,setIsHovered]=useState(false);const[cursorPos,setCursorPos]=useState({x:0,y:0});const containerRef=useRef(null);const scale=useMotionValue(0);const smoothScale=useSpring(scale,{stiffness:85,damping:18,restDelta:.001});const easedScale=useTransform(smoothScale,[0,1],[0,1],{ease:t=>t*t});const handleMouseEnter=e=>{if(!containerRef.current)return;const rect=containerRef.current.getBoundingClientRect();const x=e.clientX-rect.left;const y=e.clientY-rect.top;startTransition(()=>{setCursorPos({x,y});setIsHovered(true);});scale.set(1);};const handleMouseLeave=e=>{if(!containerRef.current)return;const rect=containerRef.current.getBoundingClientRect();const x=e.clientX-rect.left;const y=e.clientY-rect.top;startTransition(()=>{setCursorPos({x,y});});scale.set(0);startTransition(()=>{setIsHovered(false);});};const width=props.style?.width===\"100%\"?\"100%\":props.style?.width||400;const height=props.style?.height===\"100%\"?\"100%\":props.style?.height||200;const maxDimension=typeof width===\"number\"&&typeof height===\"number\"?Math.max(width,height)*2:800;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor:rectangleColor,overflow:\"hidden\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",left:cursorPos.x,top:cursorPos.y,width:maxDimension,height:maxDimension,borderRadius:\"50%\",backgroundColor:circleColor,scale:easedScale,x:\"-50%\",y:\"-50%\",pointerEvents:\"none\"}})});}addPropertyControls(OriginButton,{rectangleColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},circleColor:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#222425\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OriginButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OriginButton.map"],"mappings":"+PAKG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,iBAAe,eAAa,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAO,EAAaC,EAAO,KAAK,CAAO,EAAM,EAAe,EAAE,CAAmF,EAAW,EAA3E,EAAU,EAAM,CAAC,UAAU,GAAG,QAAQ,GAAG,UAAU,KAAK,CAAC,CAA2C,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAAO,EAAiB,GAAG,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,IAAM,EAAK,EAAa,QAAQ,uBAAuB,CAAO,EAAE,EAAE,QAAQ,EAAK,KAAW,EAAE,EAAE,QAAQ,EAAK,IAAI,MAAoB,CAAC,EAAa,CAAC,IAAE,IAAE,CAAC,CAAC,EAAa,GAAK,EAAG,CAAC,EAAM,IAAI,EAAE,EAAS,EAAiB,GAAG,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,IAAM,EAAK,EAAa,QAAQ,uBAAuB,CAAO,EAAE,EAAE,QAAQ,EAAK,KAAW,EAAE,EAAE,QAAQ,EAAK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