joshua.seigler.net/assets/main-BlSvVW40.js
Joshua Seigler 45680e24e3 Updates
2025-07-03 01:34:13 -04:00

2 lines
2.3 KiB
JavaScript

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