{"version":3,"file":"CustomCursor.Dz7syPHS.mjs","names":["React.useState","React.useRef","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","init_npm_react_dom_18_3_1","l","_e","Ha","p","c","init_jsx_runtime","ce","de","init_framer_BisrWwwE","addPropertyControls","RenderTarget","ControlType","CustomCursor","props","mounted","setMounted","dot","onCanvas","el","x","y","cx","cy","hovering","visible","i","raf","colors","hoverColors","setIdle","size","color","setHover","hoverSize","hoverOpacity","move","e","t","over","LINKS","leave","tick","smooth","hideNative","init_CustomCursor"],"sources":["https:/framerusercontent.com/modules/GgityryrRmkA7H2zWYaF/0JkgKZvXH9egLwHJBTpe/CustomCursor.js"],"sourcesContent":["// Pletórico · Cursor en círculo que sigue al ratón y cambia de color al pasar por un enlace.\n// Solo en ordenador (ratón). En móvil y tablet táctil no hace nada.\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const LINKS=\"a, button, [role='button'], [role='link'], label, summary, .pln-a, .pln-btn\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function CustomCursor(props){const{size=14,hoverSize=46,color=\"#141414\",hoverColors=[\"#297FE8\",\"#42021F\",\"#FBFFE7\"],hoverOpacity=.6,hideNative=true,smooth=.22}=props;const[mounted,setMounted]=React.useState(false);const dot=React.useRef(null);const onCanvas=RenderTarget.current()===RenderTarget.canvas;React.useEffect(()=>{if(onCanvas||typeof window===\"undefined\")return;if(!window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches)return;setMounted(true);},[onCanvas]);React.useEffect(()=>{if(!mounted)return;const el=dot.current;if(!el)return;let x=-100,y=-100,cx=-100,cy=-100;let hovering=false,visible=false,i=0,raf=0;const colors=hoverColors&&hoverColors.length?hoverColors:[\"#297FE8\"];const setIdle=()=>{el.style.width=el.style.height=size+\"px\";el.style.backgroundColor=color;el.style.opacity=visible?\"1\":\"0\";};const setHover=()=>{el.style.width=el.style.height=hoverSize+\"px\";el.style.backgroundColor=colors[i%colors.length];el.style.opacity=String(hoverOpacity);i++;};const move=e=>{x=e.clientX;y=e.clientY;if(!visible){visible=true;cx=x;cy=y;if(!hovering)el.style.opacity=\"1\";}const t=e.target;const over=!!(t&&t.closest&&t.closest(LINKS));if(over!==hovering){hovering=over;over?setHover():setIdle();}};const leave=()=>{visible=false;el.style.opacity=\"0\";};const tick=()=>{cx+=(x-cx)*smooth;cy+=(y-cy)*smooth;el.style.transform=`translate3d(${cx}px, ${cy}px, 0) translate(-50%, -50%)`;raf=requestAnimationFrame(tick);};window.addEventListener(\"pointermove\",move,{passive:true});document.documentElement.addEventListener(\"pointerleave\",leave);raf=requestAnimationFrame(tick);return()=>{window.removeEventListener(\"pointermove\",move);document.documentElement.removeEventListener(\"pointerleave\",leave);cancelAnimationFrame(raf);};},[mounted,size,hoverSize,color,hoverOpacity,smooth,(hoverColors||[]).join(\",\")]);if(!mounted)return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1}});return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1}}),/*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(_Fragment,{children:[hideNative&&/*#__PURE__*/_jsx(\"style\",{children:`@media (hover:hover) and (pointer:fine){html,body,body *{cursor:none !important}\n                        input,textarea,select,[contenteditable=\"true\"]{cursor:text !important}}`}),/*#__PURE__*/_jsx(\"div\",{ref:dot,\"aria-hidden\":\"true\",style:{position:\"fixed\",left:0,top:0,width:size,height:size,borderRadius:\"50%\",backgroundColor:color,pointerEvents:\"none\",zIndex:2147483647,opacity:0,transition:\"width .35s cubic-bezier(.16,1,.3,1), height .35s cubic-bezier(.16,1,.3,1), background-color .3s, opacity .25s\",willChange:\"transform\"}})]}),document.body)]});}addPropertyControls(CustomCursor,{size:{type:ControlType.Number,title:\"Tama\\xf1o\",min:6,max:40,step:1,unit:\"px\",defaultValue:14},hoverSize:{type:ControlType.Number,title:\"Tama\\xf1o enlace\",min:10,max:120,step:1,unit:\"px\",defaultValue:46},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#141414\"},hoverColors:{type:ControlType.Array,title:\"Colores enlace\",control:{type:ControlType.Color},defaultValue:[\"#297FE8\",\"#42021F\",\"#FBFFE7\"]},hoverOpacity:{type:ControlType.Number,title:\"Opacidad enlace\",min:.2,max:1,step:.05,defaultValue:.6},hideNative:{type:ControlType.Boolean,title:\"Ocultar flecha\",defaultValue:true},smooth:{type:ControlType.Number,title:\"Suavidad\",min:.05,max:1,step:.01,defaultValue:.22}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomCursor\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"1\",\"framerIntrinsicHeight\":\"1\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomCursor.map"],"mappings":"A,0OAOG,SAAwBoB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,GAAG,YAAU,GAAG,QAAM,UAAU,cAAY,CAAC,UAAU,UAAU,SAAS,EAAE,eAAa,GAAG,aAAW,GAAK,SAAO,KAAKC,EAAW,CAACC,EAAQC,GAAYvB,EAAe,EAAK,EAAQwB,EAAIvB,EAAa,IAAI,EAAQwB,EAASP,EAAa,QAAQ,IAAIA,EAAa,OAAikD,OAA1jDJ,MAAoB,CAAIW,GAAiBnB,IAAS,QAAuBA,EAAO,WAAW,oCAAoC,CAAC,CAAC,SAAeiB,EAAW,EAAI,CAAE,EAAE,CAACE,CAAQ,CAAC,EAAEX,MAAoB,CAAC,GAAG,CAACQ,EAAQ,OAAO,IAAMI,EAAGF,EAAI,QAAQ,GA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