{"version":3,"file":"shared-lib.C7Nx46aX.mjs","names":["useMemo","useRef","useState"],"sources":["https:/framerusercontent.com/modules/wB2oToZ9G1i63TtPaRQh/t9jojM2oLROfoLOBfs3Z/ShinyCursor_Prod.js","https:/framerusercontent.com/modules/s62WYTp3eL4DOntnir6Z/WXPgsd4WvS5yd2l2AT9C/siteMetadata.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect,useMemo,useState}from\"react\";import{cubicBezier}from\"framer-motion\";const brightnessCurve=cubicBezier(.6,.18,.84,.7);/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n *\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n */export default function ShinyCursor(props){const{color,size,brightness,edgeBlur}=props;const id=useMemo(generateId,[]);const filterRef=useRef(null);const ref=useRef(null);const pointLightRef=useRef(null);const mousePosition=useRef({x:0,y:0});const parentRef=useRef(null);const[initialized,setInitialized]=useState(false);useEffect(()=>{if(ref.current){const container=ref.current.parentElement;if(container){const parentElement=container.parentElement;if(parentElement){parentRef.current=parentElement;parentElement.style.filter=`url(#${id})`;parentElement.style.isolation=\"isolate\";}}}if(filterRef.current){filterRef.current.id=id;}},[ref.current,id]);useEffect(()=>{const handlePointerMove=event=>{mousePosition.current={x:event.pageX-window.pageXOffset,y:event.pageY-window.pageYOffset};setInitialized(true);if(!parentRef.current||!pointLightRef.current)return;const rect=parentRef.current.getBoundingClientRect();pointLightRef.current.setAttribute(\"y\",(mousePosition.current.y-rect.top).toString());pointLightRef.current.setAttribute(\"x\",(mousePosition.current.x-rect.left).toString());};const handleScroll=()=>{if(!parentRef.current||!pointLightRef.current)return;const rect=parentRef.current.getBoundingClientRect();pointLightRef.current.setAttribute(\"y\",(mousePosition.current.y-rect.top).toString());pointLightRef.current.setAttribute(\"x\",(mousePosition.current.x-rect.left).toString());};document.addEventListener(\"pointermove\",handlePointerMove);document.addEventListener(\"scroll\",handleScroll);return()=>{document.removeEventListener(\"pointermove\",handlePointerMove);document.removeEventListener(\"scroll\",handleScroll);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...props.style,width:0,height:0},children:initialized&&/*#__PURE__*/_jsx(\"svg\",{width:\"0\",height:\"0\",children:/*#__PURE__*/_jsxs(\"filter\",{id:id,ref:filterRef,colorInterpolationFilters:\"sRGB\",children:[/*#__PURE__*/_jsx(\"feGaussianBlur\",{in:\"SourceAlpha\",stdDeviation:edgeBlur,result:\"blur1\"}),/*#__PURE__*/_jsx(\"feSpecularLighting\",{result:\"spec1\",in:\"blur1\",surfaceScale:5,specularConstant:brightnessCurve(brightness/100),specularExponent:100,lightingColor:color,children:/*#__PURE__*/_jsx(\"fePointLight\",{ref:pointLightRef,x:\"0\",y:\"0\",z:mapRange(size,10,200,100,600)})}),/*#__PURE__*/_jsx(\"feComposite\",{in:\"spec1\",in2:\"SourceAlpha\",operator:\"in\",result:\"specOut2\"}),/*#__PURE__*/_jsx(\"feComposite\",{in:\"SourceGraphic\",in2:\"specOut2\",operator:\"arithmetic\",k1:\"0\",k2:\"1\",k3:\"1\",k4:\"0\",result:\"litPaint\"})]})})});}ShinyCursor.displayName=\"Shiny Cursor\";addPropertyControls(ShinyCursor,{color:{type:ControlType.Color,defaultValue:\"#ffffff\"},size:{type:ControlType.Number,defaultValue:100,min:10,max:200,step:1},brightness:{type:ControlType.Number,defaultValue:75,min:0,max:100,step:1,unit:\"%\"},edgeBlur:{type:ControlType.Number,defaultValue:10,min:0,max:25,step:.1,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});function mapRange(value,fromLow,fromHigh,toLow,toHigh){if(fromLow===fromHigh){return toLow;}const percentage=(value-fromLow)/(fromHigh-fromLow);return toLow+percentage*(toHigh-toLow);}const CHARACTERS=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";function generateId(){let result=\"\";for(let i=0;i<8;i++){const randomIndex=Math.floor(Math.random()*CHARACTERS.length);result+=CHARACTERS.charAt(randomIndex);}return result;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShinyCursor\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShinyCursor_Prod.map","// Generated by Framer (26c37fd)\nexport default function metadata(params,activeLocale){return{description:\"Shiny Cursor Effect for Framer. Created by Framer University.\",favicon:\"https://framerusercontent.com/assets/5cobUGTEj03dPTNLhGrQTXXW7M.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/EYDoRCpbcljgoZvlLeODmk0N0.jpg\",title:\"Shiny Cursor Effect by Framer University\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"gQAQG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,aAAW,YAAU,EAAY,EAAGA,EAAQ,EAAW,CAAC,CAAC,EAAQ,EAAUC,EAAO,IAAI,EAAQ,EAAIA,EAAO,IAAI,EAAQ,EAAcA,EAAO,IAAI,EAAQ,EAAcA,EAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAQ,EAAUA,EAAO,IAAI,EAAO,CAAC,EAAY,GAAgBC,EAAS,EAAK,EAAuyC,OAAryC,MAAc,CAAC,GAAG,EAAI,QAAQ,CAAC,IAAM,EAAU,EAAI,QAAQ,cAAc,GAAG,EAAU,CAAC,IAAM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