hugo-theme-minima/minima.1667927974.js

2 lines
769 B
JavaScript
Raw Normal View History

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