diff options
author | Doge <[email protected]> | 2021-05-10 02:03:03 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-10 02:03:03 +0800 |
commit | 76d845da651bb474f5d933dab1298c72d91d3a35 (patch) | |
tree | 053933b1086a19916c11901c02754628efc476ee /source/js | |
parent | 87d70cf685dad800e392069af45b7debe9818369 (diff) | |
download | chromate-76d845da651bb474f5d933dab1298c72d91d3a35.tar.gz chromate-76d845da651bb474f5d933dab1298c72d91d3a35.tar.bz2 chromate-76d845da651bb474f5d933dab1298c72d91d3a35.zip |
Add compressed js and css
Diffstat (limited to 'source/js')
-rw-r--r-- | source/js/script.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/js/script.min.js b/source/js/script.min.js new file mode 100644 index 0000000..078e42b --- /dev/null +++ b/source/js/script.min.js @@ -0,0 +1 @@ +"use strict"; window.addEventListener("load", function () { var a = Array.prototype.slice.call(document.querySelectorAll(".navbar-burger"), 0); if (a.length > 0) { a.forEach(function (c) { c.addEventListener("click", function () { var e = c.getAttribute("data-target"); c.classList.toggle("is-active"); if (!e) { return } var d = document.getElementById(e); d === null || d === void 0 ? void 0 : d.classList.toggle("is-active") }, false) }) } var b = function (e) { var d = ".auto-dark"; var c = Array.prototype.slice.call(document.querySelectorAll(d), 0); c.forEach(function (f) { if (e === SystemDarkmodePrefrence.dark) { f === null || f === void 0 ? void 0 : f.classList.add("is-dark"); f === null || f === void 0 ? void 0 : f.classList.remove("is-light") } else { f === null || f === void 0 ? void 0 : f.classList.add("is-light"); f === null || f === void 0 ? void 0 : f.classList.remove("is-dark") } }) }; darklistener.add(b) }); var SystemDarkmodePrefrence; (function (a) { a[a["dark"] = 0] = "dark"; a[a["light"] = 1] = "light" })(SystemDarkmodePrefrence || (SystemDarkmodePrefrence = {})); var DarkmodeListener = (function () { function a() { var b = window.matchMedia("(prefers-color-scheme: dark)").matches; this._mode = b ? SystemDarkmodePrefrence.dark : SystemDarkmodePrefrence.light; this._handlers = []; this._listen() } a.prototype._listen = function () { var d = this; var b = window.matchMedia("(prefers-color-scheme: dark)"); var c = function (e) { var f = e.matches ? SystemDarkmodePrefrence.dark : SystemDarkmodePrefrence.light; d._handlers.forEach(function (g) { g(f) }); d._mode = f }; b.addEventListener("change", c) }; a.prototype.add = function (b) { b(this._mode); this._handlers.push(b) }; a.prototype.mode = function () { return this._mode }; return a }()); var darklistener = new DarkmodeListener();
\ No newline at end of file |