From 099ad29bffc27548255f25548845fcf021b99e33 Mon Sep 17 00:00:00 2001 From: shy <1061867552@qq.com> Date: Fri, 21 Oct 2022 10:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8A=A5=E9=94=99js=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/heo.js | 30 +++++++++++++-------------- templates/assets/js/main.js | 14 ++++++------- templates/assets/zhheo/blogex.js | 18 ++++++++-------- templates/modules/layouts/layout.html | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index dc1cdaa1..37c25698 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -104,23 +104,23 @@ var heo_keyboard = !0, heo = { }, - showLoading: function () { - document.querySelector("#loading-box").classList.remove("loaded") - }, + // showLoading: function () { + // document.querySelector("#loading-box").classList.remove("loaded") + // }, - hideLoading: function () { - document.querySelector("#loading-box").classList.add("loaded") - }, + // hideLoading: function () { + // document.querySelector("#loading-box").classList.add("loaded") + // }, - showConsole: function () { - document.querySelector("#console").classList.add("show") - }, + // showConsole: function () { + // document.querySelector("#console").classList.add("show") + // }, - hideConsole: function () { - document.querySelector("#console").classList.remove("show") - }, + // hideConsole: function () { + // document.querySelector("#console").classList.remove("show") + // }, - keyboardToggle: function () { - heo_keyboard ? (heo_keyboard = !1, document.querySelector("#consoleKeyboard").classList.remove("on"), localStorage.setItem("keyboardToggle", "false")) : (heo_keyboard = !0, document.querySelector("#consoleKeyboard").classList.add("on"), localStorage.setItem("keyboardToggle", "true")) - } + // keyboardToggle: function () { + // heo_keyboard ? (heo_keyboard = !1, document.querySelector("#consoleKeyboard").classList.remove("on"), localStorage.setItem("keyboardToggle", "false")) : (heo_keyboard = !0, document.querySelector("#consoleKeyboard").classList.add("on"), localStorage.setItem("keyboardToggle", "true")) + // } }; \ No newline at end of file diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js index 79f76b55..c71f4f05 100644 --- a/templates/assets/js/main.js +++ b/templates/assets/js/main.js @@ -82,13 +82,13 @@ document.addEventListener("DOMContentLoaded", function () { }) } - function A() { - var a, c, r, s, l, d, u = document.getElementById("rightside"), f = window.innerHeight + 56; - document.body.scrollHeight <= f ? u.style.cssText = "opacity: 1; transform: translateX(-38px)" : (c = !(a = 0), r = document.getElementById("page-header"), document.getElementById("guli_top"), s = document.getElementById("cookies-window"), l = "function" == typeof chatBtnHide, d = "function" == typeof chatBtnShow, window.addEventListener("scroll", btf.throttle(function (t) { - var e, n, o = window.scrollY || document.documentElement.scrollTop, i = (n = a < (e = o), a = e, n); - 56 < o ? (i ? (r.classList.contains("nav-visible") && r.classList.remove("nav-visible"), d && !0 === c && (chatBtnHide(), c = !1)) : (r.classList.contains("nav-visible") || r.classList.add("nav-visible"), l && !1 === c && (chatBtnShow(), c = !0)), r.classList.add("nav-fixed"), s.classList.add("cw-hide"), "0" === window.getComputedStyle(u).getPropertyValue("opacity") && (u.style.cssText = "opacity: 1; transform: translateX(-38px)")) : (0 === o && r.classList.remove("nav-fixed", "nav-visible"), u.style.cssText = "opacity: ''; transform: ''"), document.body.scrollHeight <= f && (u.style.cssText = "opacity: 1; transform: translateX(-38px)") - }, 200))) - } + // function A() { + // var a, c, r, s, l, d, u = document.getElementById("rightside"), f = window.innerHeight + 56; + // document.body.scrollHeight <= f ? u.style.cssText = "opacity: 1; transform: translateX(-38px)" : (c = !(a = 0), r = document.getElementById("page-header"), document.getElementById("guli_top"), s = document.getElementById("cookies-window"), l = "function" == typeof chatBtnHide, d = "function" == typeof chatBtnShow, window.addEventListener("scroll", btf.throttle(function (t) { + // var e, n, o = window.scrollY || document.documentElement.scrollTop, i = (n = a < (e = o), a = e, n); + // 56 < o ? (i ? (r.classList.contains("nav-visible") && r.classList.remove("nav-visible"), d && !0 === c && (chatBtnHide(), c = !1)) : (r.classList.contains("nav-visible") || r.classList.add("nav-visible"), l && !1 === c && (chatBtnShow(), c = !0)), r.classList.add("nav-fixed"), s.classList.add("cw-hide"), "0" === window.getComputedStyle(u).getPropertyValue("opacity") && (u.style.cssText = "opacity: 1; transform: translateX(-38px)")) : (0 === o && r.classList.remove("nav-fixed", "nav-visible"), u.style.cssText = "opacity: ''; transform: ''"), document.body.scrollHeight <= f && (u.style.cssText = "opacity: 1; transform: translateX(-38px)") + // }, 200))) + // } function S() { var t = document.getElementById("card-toc"), r = t.getElementsByClassName("toc-content")[0], diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js index 576684e3..4f29b26f 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -64,15 +64,15 @@ function checkOpen() { // https://blog.zhheo.com/p/c86d8f1f.html // ?imageAve 使用 七牛云获取图片主色调,阿里云 oss 则是 @imageAve // TODO 可以切换为使用本地 JS 获取色调 -function coverColor() { - var _document$getElementB, - path = null === (_document$getElementB = document.getElementById("post-cover")) || void 0 === _document$getElementB ? void 0 : _document$getElementB.src, - httpRequest; - void 0 !== path ? (httpRequest = new XMLHttpRequest, httpRequest.open("GET", path + "?imageAve", !0), httpRequest.send(), httpRequest.onreadystatechange = function () { - var json, obj, value, value; - 4 == httpRequest.readyState && 200 == httpRequest.status && (json = httpRequest.responseText, obj = eval("(" + json + ")"), value = obj.RGB, value = "#" + value.slice(2), "light" == getContrastYIQ(value) && (value = LightenDarkenColor(colorHex(value), -40)), document.styleSheets[0].addRule(":root", "--heo-main:" + value + "!important"), document.styleSheets[0].addRule(":root", "--heo-main-op:" + value + "23!important"), document.styleSheets[0].addRule(":root", "--heo-main-none:" + value + "00!important"), heo.initThemeColor(), document.getElementById("coverdiv").classList.add("loaded")) - }) : (document.styleSheets[0].addRule(":root", "--heo-main: var(--heo-theme)!important"), document.styleSheets[0].addRule(":root", "--heo-main-op: var(--heo-theme-op)!important"), document.styleSheets[0].addRule(":root", "--heo-main-none: var(--heo-theme-none)!important"), heo.initThemeColor()) -} +// function coverColor() { +// var _document$getElementB, +// path = null === (_document$getElementB = document.getElementById("post-cover")) || void 0 === _document$getElementB ? void 0 : _document$getElementB.src, +// httpRequest; +// void 0 !== path ? (httpRequest = new XMLHttpRequest, httpRequest.open("GET", path + "?imageAve", !0), httpRequest.send(), httpRequest.onreadystatechange = function () { +// var json, obj, value, value; +// 4 == httpRequest.readyState && 200 == httpRequest.status && (json = httpRequest.responseText, obj = eval("(" + json + ")"), value = obj.RGB, value = "#" + value.slice(2), "light" == getContrastYIQ(value) && (value = LightenDarkenColor(colorHex(value), -40)), document.styleSheets[0].addRule(":root", "--heo-main:" + value + "!important"), document.styleSheets[0].addRule(":root", "--heo-main-op:" + value + "23!important"), document.styleSheets[0].addRule(":root", "--heo-main-none:" + value + "00!important"), heo.initThemeColor(), document.getElementById("coverdiv").classList.add("loaded")) +// }) : (document.styleSheets[0].addRule(":root", "--heo-main: var(--heo-theme)!important"), document.styleSheets[0].addRule(":root", "--heo-main-op: var(--heo-theme-op)!important"), document.styleSheets[0].addRule(":root", "--heo-main-none: var(--heo-theme-none)!important"), heo.initThemeColor()) +// } function colorHex(e) { var t = e; diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 55d073be..5d14ac25 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -144,7 +144,7 @@