{"version":3,"file":"Encryption_onHover.DwCffHoL.mjs","names":["useState","useRef","iteration"],"sources":["https:/framerusercontent.com/modules/AeXxxUQcxcOuKsf8PYRB/GcpGi4O7Ect3HcOWWE7l/Encryption_onHover.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";// Configure animation settings\nconst hoverDelay=100;const resetDelay=1e3;// Do not configure\nconst letters=\"abcdefghijklmnopqrstuvwxyz-.,+*!?@&%/=\";export function onHover(Component){return props=>{const value=props.children.props.children.props.children;const[isHovering,setIsHovering]=useState(false);const[iteration,setIteration]=useState(0);const componentRef=useRef(null);const encrypt=iteration=>{return value.split(\"\").map((letter,index)=>{if(index<iteration){return value[index];}return letters[Math.floor(Math.random()*38)];}).join(\"\");};useEffect(()=>{let interval=null;if(isHovering){// Reset iteration when starting to hover\nsetIteration(0);interval=setTimeout(()=>{setIteration(prev=>prev+5/6);interval=setInterval(()=>{setIteration(prev=>prev+5/6);},50);},hoverDelay);}else{// Clear any ongoing animation immediately when hover ends\nclearInterval(interval);setIteration(0);}return()=>{if(interval)clearInterval(interval);};},[isHovering]);const handleMouseEnter=()=>{setIsHovering(true);};const handleMouseLeave=()=>{setIsHovering(false);};return /*#__PURE__*/_jsx(Component,{ref:componentRef,...props,text:isHovering?encrypt(iteration):value,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave});};}// Original functions kept for reference\nexport function onAppear(Component){// ... existing onAppear code\n}export function onLoop(Component){// ... existing onLoop code\n}\nexport const __FramerMetadata__ = {\"exports\":{\"onLoop\":{\"type\":\"reactHoc\",\"name\":\"onLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"onHover\":{\"type\":\"reactHoc\",\"name\":\"onHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"onAppear\":{\"type\":\"reactHoc\",\"name\":\"onAppear\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Encryption_onHover.map"],"mappings":"2KAEuD,SAAgB,EAAQ,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAM,EAAM,SAAS,MAAM,SAAS,MAAM,SAAc,CAAC,EAAW,EAAc,CAACA,EAAS,IAAY,CAAC,EAAU,EAAa,CAACA,EAAS,GAAS,EAAaC,EAAO,MAAY,EAAQ,GAAmB,EAAM,MAAM,IAAI,KAAK,EAAO,IAAY,EAAMC,EAAkB,EAAM,GAAe,EAAQ,KAAK,MAAM,KAAK,SAAS,MAAQ,KAAK,IAAM,MAAc,CAAC,IAAI,EAAS,YAAQ,GAC1e,EAAa,GAAG,EAAS,eAAe,CAAC,EAAa,GAAM,EAAK,EAAE,GAAG,EAAS,gBAAgB,CAAC,EAAa,GAAM,EAAK,EAAE,EAAI,EAAC,GAAK,EAAC,KACrI,cAAc,GAAU,EAAa,QAAc,CAAI,GAAS,cAAc,EAAW,CAAE,EAAC,CAAC,EAAW,EAAE,IAAM,MAAqB,CAAC,EAAc,GAAO,EAAO,MAAqB,CAAC,EAAc,GAAQ,EAAC,OAAoB,EAAK,EAAU,CAAC,IAAI,EAAa,GAAG,EAAM,KAAK,EAAW,EAAQ,GAAW,EAAM,aAAa,EAAiB,aAAa,EAAiB,CAAG,CAAE,2BAHjX,EAAW,IACX,EAAQ"}