joshua.seigler.net/assets/main-CdOn50KG.js
Joshua Seigler 49092fb0df Updates
2025-06-28 02:14:29 -04:00

2 lines
2.1 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"]'))c(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"&&c(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 c(e){if(e.ep)return;e.ep=!0;const r=i(e);fetch(e.href,r)}})();window.matchMedia("(prefers-color-scheme: dark)");function f({target:o}){const t=document.querySelector("#effects");if(t==null)return;Array.from(t.children).filter(c=>c.__effectParent===o).forEach(c=>{c.getAnimations().forEach(e=>{if(+(e.currentTime??0)<100){e.pause(),t.removeChild(c);return}e.pause(),e.updatePlaybackRate(-.25),e.play(),e.addEventListener("finish",()=>{t.contains(c)&&t.removeChild(c)})})})}function p(o){return o!==null&&typeof o.matches=="function"}function d({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"),c=Array.from(o.getClientRects());Array.from(o.children).forEach(e=>{c.push(...Array.from(e.getClientRects()))}),c.forEach(e=>{const{top:r,left:s,width:u,height:a}=e,n=document.createElement("div");n.__effectParent=o,n.classList.add("effect-instance");const l="10rem";n.style.top=`calc(${r+window.scrollY}px - ${l})`,n.style.left=`calc(${s+window.scrollX}px - ${l})`,n.style.width=`calc(${u}px + 2 * ${l})`,n.style.height=`calc(${a}px + 2 * ${l})`,n.style.setProperty("--glowColor",i),t==null||t.appendChild(n)})}document.addEventListener("mouseenter",d,!0);document.addEventListener("focus",d,!0);document.addEventListener("mouseleave",f,!0);document.addEventListener("blur",f,!0);
//# sourceMappingURL=main-CdOn50KG.js.map