hugo-theme-hello-friend/static/assets/main.js

1 line
1.8 KiB
JavaScript
Raw Permalink Normal View History

2018-08-24 09:42:15 +02:00
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),n(2),e.exports=n(3)},function(e,t,n){"use strict"},function(e,t,n){"use strict";var o=document.querySelector(".menu-trigger"),r=document.querySelector(".menu"),i=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),u=function(){return window.matchMedia(i).matches},c=function(){o&&o.classList.toggle("hidden",!u()),r&&r.classList.toggle("hidden",u())};c(),o&&o.addEventListener("click",function(){return r&&r.classList.toggle("hidden")}),window.addEventListener("resize",c)},function(e,t,n){"use strict";var o=window.localStorage&&window.localStorage.getItem("theme"),r=document.querySelector(".theme-toggle"),i="dark"===o||null===o;document.body.classList.toggle("dark-theme",i),r.addEventListener("click",function(){document.body.classList.toggle("dark-theme"),window.localStorage&&window.localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")})}]);