注释报错js代码

This commit is contained in:
shy 2022-10-21 10:03:10 +08:00
parent 792aa255f0
commit 099ad29bff
4 changed files with 32 additions and 32 deletions

View File

@ -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"))
// }
};

View File

@ -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],

View File

@ -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;

View File

@ -144,7 +144,7 @@
<!-- 不知道干啥的 -->
<div class="js-pjax">
<script th:inline="javascript">
coverColor();
//coverColor();
if ([[${theme.config.other.loading_box} and not ${#strings.isEmpty(theme.config.other.loading_box_img)}]]) {
// 移除加载动画