github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/site/static/assets/main.js (about)

     1  !function(){var e,t,n,o,i,r,c,d,s,a,l;e=document.querySelector(".container"),t=document.querySelector(".menu"),n=document.querySelector(".menu-trigger"),o=document.querySelector(".menu__inner--desktop"),i=document.querySelectorAll(".menu__sub-inner-more"),r=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),c=function(){return window.matchMedia(r).matches},d=function(){n&&n.classList.toggle("hidden",!c()),t&&t.classList.toggle("hidden",c()),i.forEach((function(e){return e.classList.toggle("hidden",!c())}))},t&&t.addEventListener("click",(function(e){return e.stopPropagation()})),i.forEach((function(e){return e.addEventListener("click",(function(e){return e.stopPropagation()}))})),d(),document.body.addEventListener("click",(function(){c()?c()&&!t.classList.contains("hidden")&&t.classList.add("hidden"):i.forEach((function(e){return e.classList.add("hidden")}))})),window.addEventListener("resize",d),n&&n.addEventListener("click",(function(e){e.stopPropagation(),t&&t.classList.toggle("hidden")})),o&&o.querySelectorAll(".menu__sub-inner").forEach((function(t){var n=t.querySelector(".menu__sub-inner-more-trigger"),o=t.querySelector(".menu__sub-inner-more");n.addEventListener("click",(function(t){i.forEach((function(e){e!==o&&e.classList.add("hidden")})),t.stopPropagation(),o&&o.classList.toggle("hidden"),o&&o.getBoundingClientRect().right>e.getBoundingClientRect().right&&(o.style.left="auto",o.style.right=0)}))})),s=window.localStorage&&window.localStorage.getItem("theme"),a=document.querySelector(".theme-toggle"),l="dark"===s,null!==s&&document.body.classList.toggle("dark-theme",l),a.addEventListener("click",(function(){document.body.classList.toggle("dark-theme"),window.localStorage&&window.localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")}))}();