hugo-theme-minima/minima.1638119114.js
2021-11-28 17:05:14 +00:00

1 line
848 B
JavaScript

(()=>{var a="🌝",l="🌚",m="utterances",c="light",r="dark",n=document.getElementById("theme-switcher");n.innerHTML=localStorage.theme===c?a:l;n.addEventListener("click",function(){let e=localStorage.theme,t=e===c?r:c;u(e,t),m==="utterances"&&d(`github-${t}`)});function u(e,t){let{classList:s}=document.documentElement,i=t===c?a:l;s.remove(e),s.add(t),localStorage.theme=t,n.innerHTML=i}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","Helvatica sans-serif");var f="true";f==="false"&&(document.documentElement.style="user-select:none");})();