{"version":3,"file":"Link_random_hover.DTh4wCOO.mjs","names":["useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/emauzNsXJx3TozTfpUMg/OdbiNm4YrLM6luaiFjY8/Link_random_hover.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function RandomLinkHover(){const[activeIndex,setActiveIndex]=useState(0);const fadeDuration=300// fade in/out time in ms\n;useEffect(()=>{const wrapper=document.getElementById(\"linkWrapper\");if(!wrapper)return;const links=Array.from(wrapper.children);if(links.length===0)return;// Stack all links on top of each other\nlinks.forEach((link,index)=>{link.style.position=\"absolute\";link.style.transition=`opacity ${fadeDuration}ms ease`;link.style.opacity=index===0?\"1\":\"0\"// first link visible\n;link.style.pointerEvents=index===0?\"auto\":\"none\";});wrapper.style.position=\"relative\"// ensure absolute positioning works\n;},[]);const showNextLink=()=>{const wrapper=document.getElementById(\"linkWrapper\");if(!wrapper)return;const links=Array.from(wrapper.children);if(links.length<=1)return;// Compute next index in cycle\nconst nextIndex=(activeIndex+1)%links.length;links.forEach((link,index)=>{if(index===nextIndex){link.style.opacity=\"1\";link.style.pointerEvents=\"auto\";}else{link.style.opacity=\"0\";link.style.pointerEvents=\"none\";}});setActiveIndex(nextIndex);};const handleHoverOut=()=>{// Delay a bit to let hover-out animations finish\nsetTimeout(()=>{showNextLink();},fadeDuration);};return{id:\"linkWrapper\",onMouseEnter:showNextLink,onMouseLeave:handleHoverOut};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRandomLinkHover(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RandomLinkHover(props)});};}withRandomLinkHover.displayName=\"RandomLinkHover\";\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomLinkHover\":{\"type\":\"reactHoc\",\"name\":\"withRandomLinkHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RandomLinkHover\":{\"type\":\"override\",\"name\":\"RandomLinkHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Link_random_hover.map"],"mappings":"4KAAiF,SAAgB,GAAiB,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAS,EAAE,CAC/J,MAAc,CAAC,IAAM,EAAQ,SAAS,eAAe,cAAc,CAAC,GAAG,CAAC,EAAQ,OAAO,IAAM,EAAM,MAAM,KAAK,EAAQ,SAAS,CAAI,EAAM,SAAS,IACnJ,EAAM,SAAS,EAAK,IAAQ,CAAC,EAAK,MAAM,SAAS,WAAW,EAAK,MAAM,WAAW,qBAAiC,EAAK,MAAM,QAAQ,IAAQ,EAAE,IAAI,IACnJ,EAAK,MAAM,cAAc,IAAQ,EAAE,OAAO,QAAS,CAAC,EAAQ,MAAM,SAAS,aACzE,EAAE,CAAC,CAAC,IAAM,MAAiB,CAAC,IAAM,EAAQ,SAAS,eAAe,cAAc,CAAC,GAAG,CAAC,EAAQ,OAAO,IAAM,EAAM,MAAM,KAAK,EAAQ,SAAS,CAAC,GAAG,EAAM,QAAQ,EAAE,OACnK,IAAM,GAAW,EAAY,GAAG,EAAM,OAAO,EAAM,SAAS,EAAK,IAAQ,CAAI,IAAQ,GAAW,EAAK,MAAM,QAAQ,IAAI,EAAK,MAAM,cAAc,SAAa,EAAK,MAAM,QAAQ,IAAI,EAAK,MAAM,cAAc,SAAU,CAAC,EAAe,EAAU,EAChM,MAAM,CAAC,GAAG,cAAc,aAAa,EAAa,iBAD0K,CAC7Q,eAAe,CAAC,GAAc,EAAG,IAAa,EAAiF,CAAqJ,SAAgB,EAAoB,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAgB,EAAM,CAAC,CAAC,mBAN1Z,IAAsC,IAMmM,CAAqL,EAAoB,YAAY"}