hugo-theme-minima/minima.1643210480.js
2022-01-26 15:21:21 +00:00

1 line
828 B
JavaScript

(()=>{var a="🌝",i="🌚",r="utterances",c="light",m="dark",n=document.getElementById("theme-switcher");n.innerHTML=localStorage.theme===c?a:i;n.addEventListener("click",function(){let e=localStorage.theme,t=e===c?m:c;u(e,t),r==="utterances"&&d(`github-${t}`)});function u(e,t){let{classList:s}=document.documentElement,l=t===c?a:i;s.remove(e),s.add(t),localStorage.theme=t,n.innerHTML=l}var h=".utterances-frame",o;function d(e){o||(o=document.querySelector(h)),o.contentWindow.postMessage({type:"set-theme",theme:e},"https://utteranc.es")}document.querySelectorAll(".md ul").forEach(e=>{/<li><input .+>.+<\/li>/.test(e.innerHTML)&&e.classList.add("ul-checkbox")});document.querySelector("body").style.setProperty("--global-font-family","");var f="true";f==="false"&&(document.documentElement.style="user-select:none");})();