{"version":3,"file":"Grain.xBamn9Ly.mjs","names":["useMemo","useRef","useState","n"],"sources":["https:/framerusercontent.com/modules/wB2oToZ9G1i63TtPaRQh/t9jojM2oLROfoLOBfs3Z/ShinyCursor_Prod.js","https:/ga.jspm.io/npm:@motionone/utils@10.14.0/dist/index.es.js","https:/ga.jspm.io/npm:@motionone/easing@10.18.0/dist/index.es.js","https:/framerusercontent.com/modules/cKGD16u2MGB7MfqfVXFp/wiztTCbXokZrMicHAmZc/Grain.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","function addUniqueItem(t,e){-1===t.indexOf(e)&&t.push(e)}function removeItem(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const clamp=(t,e,n)=>Math.min(Math.max(n,t),e);const t={duration:.3,delay:0,endDelay:0,repeat:0,easing:\"ease\"};const isNumber=t=>\"number\"===typeof t;const isEasingList=t=>Array.isArray(t)&&!isNumber(t[0]);const wrap=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};function getEasingForSegment(t,e){return isEasingList(t)?t[wrap(0,t.length,e)]:t}const mix=(t,e,n)=>-n*t+n*e+t;const noop=()=>{};const noopReturn=t=>t;const progress=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function fillOffset(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const s=progress(0,e,o);t.push(mix(n,1,s))}}function defaultOffset(t){const e=[0];fillOffset(e,t-1);return e}function interpolate(t,e=defaultOffset(t.length),n=noopReturn){const o=t.length;const s=o-e.length;s>0&&fillOffset(e,s);return s=>{let f=0;for(;f<o-2;f++)if(s<e[f+1])break;let r=clamp(0,1,progress(e[f],e[f+1],s));const c=getEasingForSegment(n,f);r=c(r);return mix(t[f],t[f+1],r)}}const isCubicBezier=t=>Array.isArray(t)&&isNumber(t[0]);const isEasingGenerator=t=>\"object\"===typeof t&&Boolean(t.createAnimation);const isFunction=t=>\"function\"===typeof t;const isString=t=>\"string\"===typeof t;const e={ms:t=>1e3*t,s:t=>t/1e3};\n/*\n  Convert velocity into velocity per second\n\n  @param [number]: Unit per frame\n  @param [number]: Frame duration in ms\n*/function velocityPerSecond(t,e){return e?t*(1e3/e):0}export{addUniqueItem,clamp,defaultOffset,t as defaults,fillOffset,getEasingForSegment,interpolate,isCubicBezier,isEasingGenerator,isEasingList,isFunction,isNumber,isString,mix,noop,noopReturn,progress,removeItem,e as time,velocityPerSecond,wrap};\n\n//# sourceMappingURL=index.es.js.map","import{noopReturn as t,clamp as n}from\"@motionone/utils\";const calcBezier=(t,n,e)=>(((1-3*e+3*n)*t+(3*e-6*n))*t+3*n)*t;const e=1e-7;const i=12;function binarySubdivide(t,n,o,r,c){let u;let a;let s=0;do{a=n+(o-n)/2;u=calcBezier(a,r,c)-t;u>0?o=a:n=a}while(Math.abs(u)>e&&++s<i);return a}function cubicBezier(n,e,i,o){if(n===e&&i===o)return t;const getTForX=t=>binarySubdivide(t,0,1,n,i);return t=>t===0||t===1?t:calcBezier(getTForX(t),e,o)}const steps=(t,e=\"end\")=>i=>{i=e===\"end\"?Math.min(i,.999):Math.max(i,.001);const o=i*t;const r=e===\"end\"?Math.floor(o):Math.ceil(o);return n(0,1,r/t)};export{cubicBezier,steps};\n//# sourceMappingURL=index.es.js.map\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";import{steps}from\"@motionone/easing\";/**\n * @framerIntrinsicWidth 100\n * @framerIntrinsicHeight 100\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export default function Grain(props){const{opacity,style}=props;const keyframesX=[\"0%\",\"-5%\",\"-15%\",\"7%\",\"-5%\",\"-15%\",\"15%\",\"0%\",\"3%\",\"-10%\",];const keyframesY=[\"0%\",\"-10%\",\"5%\",\"-25%\",\"25%\",\"10%\",\"0%\",\"15%\",\"35%\",\"10%\",];const isCanvas=RenderTarget.current()===RenderTarget.canvas;return /*#__PURE__*/ _jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/ _jsx(motion.div,{style:{...containerStyle,opacity:opacity,inset:isCanvas?0:\"-200%\",width:isCanvas?\"100%\":\"400%\",height:isCanvas?\"100%\":\"400%\",position:\"absolute\"},animate:!isCanvas&&{x:keyframesX,y:keyframesY},transition:{ease:steps(10,\"start\"),repeat:Infinity,duration:8}})});};Grain.defaultProps={opacity:.5};addPropertyControls(Grain,{opacity:{title:\"Opacity\",type:ControlType.Number,step:.1,displayStepper:true,max:1,min:0}});const containerStyle={backgroundSize:\"256px 256px\",backgroundRepeat:\"repeat\",background:\"url('https://framerusercontent.com/images/rR6HYXBrMmX4cRpXfXUOvpvpB0.png')\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Grain\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"100\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Grain.map"],"mappings":"8QAQG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,aAAW,YAAU,EAAY,EAAGA,EAAQ,EAAW,EAAE,CAAC,CAAO,EAAUC,EAAO,KAAK,CAAO,EAAIA,EAAO,KAAK,CAAO,EAAcA,EAAO,KAAK,CAAO,EAAcA,EAAO,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAO,EAAUA,EAAO,KAAK,CAAM,CAAC,EAAY,GAAgBC,EAAS,GAAM,CAAsyC,OAAryC,MAAc,CAAC,GAAG,EAAI,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