Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/okikio/native. An initiative which aims to make it easy to create complex, light-weight, and perfor okikio.github.io/native
Something went wrong. Try again.
1!function(){var e=function(){var e=window.localStorage.getItem("theme");return"string"==typeof e?e:null},t=function(e){"string"==typeof e&&window.localStorage.setItem("theme",e)},n=document.querySelector("html"),o=function(e){n.setAttribute("data-theme",e),n.classList.toggle("dark","dark"==e)},r=function(){document.removeEventListener("DOMContentLoaded",r),window.removeEventListener("load",r);try{var a=Array.from(document.querySelectorAll(".theme-toggle"));if(a[0])for(var i=0,d=a;i<d.length;i++){d[i].addEventListener("click",(function(){var r,a="dark"===("string"==typeof(r=n.getAttribute("data-theme"))&&r.length?r:e())?"light":"dark";o(a),t(a)}))}}catch(e){console.warn("Theming seems to break on this browser.",e)}}.bind(void 0);!function(){try{var t=e();null===t&&(t="boolean"==typeof(n=window.matchMedia("(prefers-color-scheme: dark)")).matches?n.matches?"dark":"light":null),t&&o(t),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(e){o(e.matches?"dark":"light")})),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",(function(e){o(e.matches?"light":"dark")}))}catch(e){console.warn("Theming isn't available on this browser.",e)}var n}(),document.addEventListener("DOMContentLoaded",r),window.addEventListener("load",r)}();