{"version":3,"file":"MagicCursor_V2.DmFDDBKf.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/Bu4QJ6rFu3VprdR4AEZg/il3zl1fARK2hhgvZUaMc/MagicCursor_V2.js"],"sourcesContent":["// MAGIC CURSOR V2 — full upgraded version\n// - adjustable text loop gap\n// - adjustable custom width / height\n// - adjustable opacity, lag\n// - text font controls\n// - shape, color, visibility, everything\n// - marquee spacing perfectly controlled\n// - new name ensures Framer resets property controls\n// - NEW: manual cursor offset X/Y to counter overlay offset\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function MagicCursor_v2(props){const{color=\"#ffeb3b\",shape=\"circle\",visible=true,// Looping text system\nloopingText=\"\",showLoopingText=false,textColor=\"#111\",loopSpeed=5,textFont={fontFamily:\"Inter\",fontSize:14,fontWeight:500},// Spacing between loops\nloopGap=6,// Custom dimensions\ncustomWidth=null,customHeight=null,// Cursor behavior\ncursorOpacity=.6,cursorLag=15,// NEW: manual calibration offsets\ncursorOffsetX=0,cursorOffsetY=0}=props;// ------------------------\n// Motion system\n// ------------------------\nconst x=useMotionValue(0);const y=useMotionValue(0);const springX=cursorLag>0?useSpring(x,{stiffness:300,damping:cursorLag}):x;const springY=cursorLag>0?useSpring(y,{stiffness:300,damping:cursorLag}):y;const[variant,setVariant]=React.useState(\"default\");React.useEffect(()=>{if(typeof window===\"undefined\")return;const move=e=>{// ✅ Apply calibration offsets\nx.set(e.clientX+cursorOffsetX);y.set(e.clientY+cursorOffsetY);};window.addEventListener(\"mousemove\",move);const enter=()=>setVariant(\"hover\");const leave=()=>setVariant(\"default\");const hoverables=document.querySelectorAll(\"[data-cursor]\");hoverables.forEach(el=>{el.addEventListener(\"mouseenter\",enter);el.addEventListener(\"mouseleave\",leave);});return()=>{window.removeEventListener(\"mousemove\",move);hoverables.forEach(el=>{el.removeEventListener(\"mouseenter\",enter);el.removeEventListener(\"mouseleave\",leave);});};// IMPORTANT: include offsets so changes apply immediately\n},[cursorOffsetX,cursorOffsetY]);// ------------------------\n// Size logic\n// ------------------------\nconst baseSize=shape===\"square\"?24:shape===\"diamond\"?27:shape===\"outline\"?32:24;const dynamicWidth=customWidth??baseSize;const dynamicHeight=customHeight??baseSize;// ------------------------\n// Variants\n// ------------------------\nconst variants={default:{scale:1,opacity:cursorOpacity,mixBlendMode:\"normal\",borderRadius:shape===\"square\"?4:shape===\"diamond\"?\"12%\":999,background:shape===\"outline\"?\"transparent\":color,border:shape===\"outline\"?`2px solid ${color}`:undefined,width:dynamicWidth,height:dynamicHeight,rotate:shape===\"diamond\"?45:0},hover:{scale:2.2,opacity:Math.min(cursorOpacity+.4,1),mixBlendMode:\"difference\",borderRadius:shape===\"square\"?4:shape===\"diamond\"?\"12%\":999,background:shape===\"outline\"?\"transparent\":color,border:shape===\"outline\"?`2px solid ${color}`:undefined,width:dynamicWidth,height:dynamicHeight,rotate:shape===\"diamond\"?45:0}};// ------------------------\n// Inject marquee keyframes once\n// ------------------------\nReact.useEffect(()=>{if(typeof document===\"undefined\")return;if(document.head.querySelector(\"style[data-magic-cursor-loop-v2]\"))return;const styleSheet=document.createElement(\"style\");styleSheet.innerHTML=`\n@keyframes marqueeLoop_v2 {\n  0% { transform: translateX(0); }\n  100% { transform: translateX(-50%); }\n}`;styleSheet.setAttribute(\"data-magic-cursor-loop-v2\",\"1\");document.head.appendChild(styleSheet);},[]);if(typeof window===\"undefined\")return null;// ------------------------\n// Looping text content\n// ------------------------\nconst gapSpaces=\"\\xa0\".repeat(loopGap);return /*#__PURE__*/_jsx(motion.div,{style:{position:\"fixed\",top:0,left:0,// Motion values\nx:springX,y:springY,// ✅ Correct centering (DO NOT use `transform:`)\ntranslateX:\"-50%\",translateY:\"-50%\",pointerEvents:\"none\",zIndex:999999,display:visible?\"flex\":\"none\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\"},animate:variants[variant],children:showLoopingText&&loopingText&&/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\",pointerEvents:\"none\",userSelect:\"none\",display:\"flex\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:{whiteSpace:\"nowrap\",display:\"inline-block\",animation:`marqueeLoop_v2 ${loopSpeed}s linear infinite`,color:textColor,fontFamily:textFont.fontFamily,fontWeight:textFont.fontWeight??500,fontSize:textFont.fontSize??14},children:loopingText+gapSpaces+loopingText+gapSpaces})})});}MagicCursor_v2.displayName=\"MagicCursor v2 (NEW)\";addPropertyControls(MagicCursor_v2,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffeb3b\"},shape:{type:ControlType.Enum,title:\"Shape\",options:[\"circle\",\"outline\",\"square\",\"diamond\"],defaultValue:\"circle\"},visible:{type:ControlType.Boolean,title:\"Visibility\",defaultValue:true},loopingText:{type:ControlType.String,title:\"Loop Text\",placeholder:\"Type text…\"},showLoopingText:{type:ControlType.Boolean,title:\"Show Text\",defaultValue:false},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#111\",hidden:p=>!p.showLoopingText},loopSpeed:{type:ControlType.Number,title:\"Speed\",defaultValue:5,min:1,max:15,step:.1,hidden:p=>!p.showLoopingText},textFont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",hidden:p=>!p.showLoopingText},loopGap:{type:ControlType.Number,title:\"Loop Gap\",defaultValue:6,min:0,max:40,step:1,hidden:p=>!p.showLoopingText},customWidth:{type:ControlType.Number,title:\"Width\",min:10,max:300,step:1,defaultValue:null},customHeight:{type:ControlType.Number,title:\"Height\",min:10,max:300,step:1,defaultValue:null},cursorOpacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:.6,min:0,max:1,step:.05},cursorLag:{type:ControlType.Number,title:\"Lag\",defaultValue:15,min:0,max:50,step:1},// NEW: calibration offsets\ncursorOffsetX:{type:ControlType.Number,title:\"Offset X\",defaultValue:0,min:-2e3,max:2e3,step:1},cursorOffsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:0,min:-2e3,max:2e3,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagicCursor_v2\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MagicCursor_V2.map"],"mappings":"8PASsL,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,UAAU,QAAM,SAAS,UAAQ,GACjR,cAAY,GAAG,kBAAgB,GAAM,YAAU,OAAO,YAAU,EAAE,WAAS,CAAC,WAAW,QAAQ,SAAS,GAAG,WAAW,GAAG,EACzH,UAAQ,EACR,cAAY,KAAK,eAAa,KAC9B,gBAAc,GAAG,YAAU,GAC3B,gBAAc,EAAE,gBAAc,GAAG,EAG3B,EAAE,EAAe,CAAC,EAAQ,EAAE,EAAe,CAAC,EAAQ,EAAQ,EAAU,EAAE,EAAU,EAAE,CAAC,UAAU,IAAI,QAAQ,CAAS,CAAC,EAAE,EAAQ,EAAQ,EAAU,EAAE,EAAU,EAAE,CAAC,UAAU,IAAI,QAAQ,CAAS,CAAC,EAAE,EAAO,CAAC,EAAQ,GAAYA,EAAe,SAAS,EAAE,MAAoB,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAK,GAAG,CACvU,EAAE,IAAI,EAAE,QAAQ,CAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAa,CAAE,EAAE,EAAO,iBAAiB,YAAY,CAAI,EAAE,IAAM,MAAU,EAAW,OAAO,EAAQ,MAAU,EAAW,SAAS,EAAQ,EAAW,SAAS,iBAAiB,eAAe,EAA6G,OAA3G,EAAW,QAAQ,GAAI,CAAC,EAAG,iBAAiB,aAAa,CAAK,EAAE,EAAG,iBAAiB,aAAa,CAAK,CAAE,CAAC,MAAY,CAAC,EAAO,oBAAoB,YAAY,CAAI,EAAE,EAAW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