{"version":3,"file":"CustomCursor.R4Xf_b2x.mjs","names":[],"sources":["https:/framerusercontent.com/modules/uwVEDHf2PcMR22YAmKPe/KhVM8X0aufiXmUe45OaT/CustomCursor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CustomCursor(props){const{pointer,pointerSize,hotspotX,hotspotY,glowSize,glowOpacity,glowBlur,coreSize,follow,trailSize,trailOpacity,trailPersistence}=props;React.useEffect(()=>{// =====================================================\n// REMOVE OLD INSTANCE\n// =====================================================\ndocument.getElementById(\"ps2-cursor-root\")?.remove();document.getElementById(\"ps2-cursor-style\")?.remove();// =====================================================\n// HIDE NORMAL CURSOR\n// =====================================================\nconst style=document.createElement(\"style\");style.id=\"ps2-cursor-style\";style.innerHTML=`\n            html,\n            body,\n            body *,\n            a,\n            button,\n            canvas,\n            img,\n            video,\n            input,\n            textarea {\n                cursor: none !important;\n            }\n        `;document.head.appendChild(style);// =====================================================\n// ROOT\n// =====================================================\nconst root=document.createElement(\"div\");root.id=\"ps2-cursor-root\";Object.assign(root.style,{position:\"fixed\",inset:\"0\",width:\"100vw\",height:\"100vh\",pointerEvents:\"none\",zIndex:\"2147483647\",overflow:\"hidden\"});document.body.appendChild(root);// =====================================================\n// TRAIL CANVAS\n// =====================================================\nconst trailCanvas=document.createElement(\"canvas\");Object.assign(trailCanvas.style,{position:\"absolute\",inset:\"0\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",mixBlendMode:\"screen\"});root.appendChild(trailCanvas);// =====================================================\n// MAIN GLOW CANVAS\n// =====================================================\nconst glowCanvas=document.createElement(\"canvas\");Object.assign(glowCanvas.style,{position:\"absolute\",inset:\"0\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",mixBlendMode:\"screen\"});root.appendChild(glowCanvas);// =====================================================\n// OPTIONAL POINTER PNG\n// =====================================================\nlet pointerImage=null;if(pointer){pointerImage=document.createElement(\"img\");pointerImage.src=pointer;Object.assign(pointerImage.style,{position:\"absolute\",left:\"0\",top:\"0\",width:`${pointerSize}px`,height:`${pointerSize}px`,objectFit:\"contain\",pointerEvents:\"none\",userSelect:\"none\",opacity:\"0\",zIndex:\"5\",willChange:\"transform\",filter:\"drop-shadow(0 0 6px rgba(255,255,255,.85))\"});root.appendChild(pointerImage);}// =====================================================\n// CANVAS SETUP\n// =====================================================\nconst glowContext=glowCanvas.getContext(\"2d\");const trailContext=trailCanvas.getContext(\"2d\");if(!glowContext||!trailContext){return;}let dpr=Math.min(window.devicePixelRatio||1,2);function resizeCanvas(){dpr=Math.min(window.devicePixelRatio||1,2);const width=window.innerWidth;const height=window.innerHeight;glowCanvas.width=width*dpr;glowCanvas.height=height*dpr;trailCanvas.width=width*dpr;trailCanvas.height=height*dpr;glowContext.setTransform(dpr,0,0,dpr,0,0);trailContext.setTransform(dpr,0,0,dpr,0,0);}resizeCanvas();window.addEventListener(\"resize\",resizeCanvas);// =====================================================\n// DRAW PS2 GLOW\n// =====================================================\nfunction drawGlow(ctx,x,y,size,opacity,core,blur){const radius=size/2;ctx.save();ctx.globalCompositeOperation=\"lighter\";ctx.globalAlpha=opacity;// =============================================\n// LARGE OUTER BLOOM\n// =============================================\nconst outer=ctx.createRadialGradient(x,y,0,x,y,radius);outer.addColorStop(0,\"rgba(255,255,255,0.95)\");outer.addColorStop(.07,\"rgba(255,255,255,0.85)\");outer.addColorStop(.15,\"rgba(255,255,255,0.48)\");outer.addColorStop(.28,\"rgba(255,255,255,0.22)\");outer.addColorStop(.45,\"rgba(255,255,255,0.08)\");outer.addColorStop(.65,\"rgba(255,255,255,0.025)\");outer.addColorStop(1,\"rgba(255,255,255,0)\");ctx.filter=`blur(${blur}px)`;ctx.fillStyle=outer;ctx.beginPath();ctx.arc(x,y,radius,0,Math.PI*2);ctx.fill();// =============================================\n// STRONGER MID BLOOM\n// =============================================\nconst middleRadius=radius*.45;const middle=ctx.createRadialGradient(x,y,0,x,y,middleRadius);middle.addColorStop(0,\"rgba(255,255,255,1)\");middle.addColorStop(.15,\"rgba(255,255,255,.95)\");middle.addColorStop(.4,\"rgba(255,255,255,.45)\");middle.addColorStop(1,\"rgba(255,255,255,0)\");ctx.fillStyle=middle;ctx.beginPath();ctx.arc(x,y,middleRadius,0,Math.PI*2);ctx.fill();// =============================================\n// WHITE HOT CORE\n// =============================================\nctx.filter=`blur(${Math.max(0,blur*.25)}px)`;ctx.fillStyle=\"rgba(255,255,255,1)\";ctx.beginPath();ctx.arc(x,y,core/2,0,Math.PI*2);ctx.fill();ctx.restore();}// =====================================================\n// MOUSE POSITION\n// =====================================================\nlet mouseX=window.innerWidth/2;let mouseY=window.innerHeight/2;let currentX=mouseX;let currentY=mouseY;let visible=false;// =====================================================\n// EVENTS\n// =====================================================\nfunction handleMouseMove(event){mouseX=event.clientX;mouseY=event.clientY;visible=true;if(pointerImage){pointerImage.style.opacity=\"1\";}}function handleMouseLeave(){visible=false;if(pointerImage){pointerImage.style.opacity=\"0\";}}function handleMouseEnter(){visible=true;}window.addEventListener(\"mousemove\",handleMouseMove);document.addEventListener(\"mouseleave\",handleMouseLeave);document.addEventListener(\"mouseenter\",handleMouseEnter);// =====================================================\n// ANIMATION LOOP\n// =====================================================\nlet animationFrame=0;const safeFollow=Math.max(.01,Math.min(1,follow));function animate(){// =============================================\n// SMOOTH MAIN CURSOR\n// =============================================\ncurrentX+=(mouseX-currentX)*safeFollow;currentY+=(mouseY-currentY)*safeFollow;// =============================================\n// FADE OLD TRAIL\n// =============================================\ntrailContext.save();trailContext.globalCompositeOperation=\"destination-out\";trailContext.globalAlpha=Math.max(.01,1-trailPersistence);trailContext.fillStyle=\"rgba(0,0,0,1)\";trailContext.fillRect(0,0,window.innerWidth,window.innerHeight);trailContext.restore();// =============================================\n// MAIN GLOW CLEARS EACH FRAME\n// =============================================\nglowContext.clearRect(0,0,window.innerWidth,window.innerHeight);if(visible){// =========================================\n// SOFT AFTERIMAGE TRAIL\n// =========================================\ndrawGlow(trailContext,currentX,currentY,trailSize,trailOpacity,Math.max(2,coreSize*.4),glowBlur+4);// =========================================\n// BRIGHT PS2 HOTSPOT\n// =========================================\ndrawGlow(glowContext,currentX,currentY,glowSize,glowOpacity,coreSize,glowBlur);}// =============================================\n// OPTIONAL POINTER PNG\n// =============================================\nif(pointerImage&&visible){pointerImage.style.transform=`\n                    translate3d(\n                        ${currentX-hotspotX}px,\n                        ${currentY-hotspotY}px,\n                        0\n                    )\n                    `;}animationFrame=requestAnimationFrame(animate);}animate();// =====================================================\n// CLEANUP\n// =====================================================\nreturn()=>{cancelAnimationFrame(animationFrame);window.removeEventListener(\"resize\",resizeCanvas);window.removeEventListener(\"mousemove\",handleMouseMove);document.removeEventListener(\"mouseleave\",handleMouseLeave);document.removeEventListener(\"mouseenter\",handleMouseEnter);document.getElementById(\"ps2-cursor-root\")?.remove();document.getElementById(\"ps2-cursor-style\")?.remove();};},[pointer,pointerSize,hotspotX,hotspotY,glowSize,glowOpacity,glowBlur,coreSize,follow,trailSize,trailOpacity,trailPersistence]);return /*#__PURE__*/_jsx(\"div\",{});}// =========================================================\n// DEFAULT SETTINGS\n// =========================================================\nCustomCursor.defaultProps={// =====================================================\n// OPTIONAL POINTER\n// =====================================================\npointerSize:32,hotspotX:0,hotspotY:0,// =====================================================\n// PS2 MAIN WHITE GLOW\n// =====================================================\nglowSize:120,glowOpacity:.92,glowBlur:7,coreSize:10,// =====================================================\n// CURSOR MOVEMENT\n// =====================================================\nfollow:.72,// =====================================================\n// AFTERIMAGE TRAIL\n// =====================================================\ntrailSize:60,trailOpacity:.16,trailPersistence:.88};// =========================================================\n// FRAMER CONTROLS\n// =========================================================\naddPropertyControls(CustomCursor,{// =================================================\n// OPTIONAL POINTER PNG\n// =================================================\npointer:{type:ControlType.Image,title:\"Pointer\"},pointerSize:{type:ControlType.Number,title:\"Pointer Size\",defaultValue:32,min:1,max:128,step:1},hotspotX:{type:ControlType.Number,title:\"Hotspot X\",defaultValue:0,min:-64,max:64,step:1},hotspotY:{type:ControlType.Number,title:\"Hotspot Y\",defaultValue:0,min:-64,max:64,step:1},// =================================================\n// MAIN PS2 GLOW\n// =================================================\nglowSize:{type:ControlType.Number,title:\"Glow Size\",defaultValue:120,min:20,max:300,step:1},glowOpacity:{type:ControlType.Number,title:\"Glow\",defaultValue:.92,min:0,max:1,step:.01},glowBlur:{type:ControlType.Number,title:\"Glow Blur\",defaultValue:7,min:0,max:30,step:1},coreSize:{type:ControlType.Number,title:\"White Core\",defaultValue:10,min:1,max:40,step:1},// =================================================\n// MOVEMENT\n// =================================================\nfollow:{type:ControlType.Number,title:\"Follow\",defaultValue:.72,min:.05,max:1,step:.01},// =================================================\n// TRAIL\n// =================================================\ntrailSize:{type:ControlType.Number,title:\"Trail Size\",defaultValue:60,min:5,max:200,step:1},trailOpacity:{type:ControlType.Number,title:\"Trail Glow\",defaultValue:.16,min:0,max:1,step:.01},trailPersistence:{type:ControlType.Number,title:\"Trail Length\",defaultValue:.88,min:.5,max:.98,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomCursor\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomCursor.map"],"mappings":"wLAA2H,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,cAAY,WAAS,WAAS,WAAS,cAAY,WAAS,WAAS,SAAO,YAAU,eAAa,oBAAkB,EAkFsN,OAlFhN,MAAoB,CAGpU,SAAS,eAAe,iBAAiB,CAAC,EAAE,OAAO,EAAE,SAAS,eAAe,kBAAkB,CAAC,EAAE,OAAO,EAGzG,IAAM,EAAM,SAAS,cAAc,OAAO,EAAE,EAAM,GAAG,mBAAmB,EAAM,UAAU;;;;;;;;;;;;;UAa9E,SAAS,KAAK,YAAY,CAAK,EAGzC,IAAM,EAAK,SAAS,cAAc,KAAK,EAAE,EAAK,GAAG,kBAAkB,OAAO,OAAO,EAAK,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