joshua.seigler.net/assets/main-BE8UYrPP.js
Joshua Seigler 5c39e153d0 Updates
2025-06-30 12:10:12 -04:00

2 lines
2 KiB
JavaScript

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))n(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function i(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(e){if(e.ep)return;e.ep=!0;const r=i(e);fetch(e.href,r)}})();function f({target:o}){const t=document.querySelector("#effects");if(t==null)return;Array.from(t.children).filter(n=>n.__effectParent===o).forEach(n=>{n.getAnimations().forEach(e=>{if(+(e.currentTime??0)<100){e.pause(),t.removeChild(n);return}e.pause(),e.updatePlaybackRate(-.25),e.play(),e.addEventListener("finish",()=>{t.contains(n)&&t.removeChild(n)})})})}function p(o){return o!==null&&typeof o.matches=="function"}function u({target:o}){const t=document.querySelector("#effects");if(!p(o)||!o.matches("a[href],.nav-toggle-button,button,input[type='radio']"))return;const i=window.getComputedStyle(o).getPropertyValue("--glowColor"),n=Array.from(o.getClientRects());Array.from(o.children).forEach(e=>{n.push(...Array.from(e.getClientRects()))}),n.forEach(e=>{const{top:r,left:s,width:d,height:a}=e,c=document.createElement("div");c.__effectParent=o,c.classList.add("effect-instance");const l="10rem";c.style.top=`calc(${r+window.scrollY}px - ${l})`,c.style.left=`calc(${s+window.scrollX}px - ${l})`,c.style.width=`calc(${d}px + 2 * ${l})`,c.style.height=`calc(${a}px + 2 * ${l})`,c.style.setProperty("--glowColor",i),t==null||t.appendChild(c)})}document.addEventListener("mouseenter",u,!0);document.addEventListener("focus",u,!0);document.addEventListener("mouseleave",f,!0);document.addEventListener("blur",f,!0);
//# sourceMappingURL=main-BE8UYrPP.js.map