From 669c3034a3f22cbc6139efd81c5cc56be845690f Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Mon, 22 Nov 2021 18:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AC=A1=E5=8A=A0=E8=BD=BD=E7=9A=84?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=8A=A8=E7=94=BB=E6=8A=91=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9B=BE=E6=A0=87=E6=A1=86=E9=80=89=E6=8A=91?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/main.css | 5 +++++ assets/main.js | 18 ++++++++++++++++-- template/demo.html | 5 +++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/assets/main.css b/assets/main.css index d77e83a..93ff7c6 100644 --- a/assets/main.css +++ b/assets/main.css @@ -129,6 +129,10 @@ } +.prevent-animation { + transition: none !important; +} + /*#test-overflow {*/ /* display: none;*/ /*}*/ @@ -493,6 +497,7 @@ body { height: 2.2rem; width: 2.2rem; transition: background-color var(--tools-button-hover-anima-speed); + user-select: none; } #page-tools > button:hover { diff --git a/assets/main.js b/assets/main.js index d18d8f0..e38a95c 100644 --- a/assets/main.js +++ b/assets/main.js @@ -12,7 +12,6 @@ for (const node of document.getElementsByTagName("noscript")) { for (const node of document.getElementsByClassName("menu-item-parent")) { if (node.parentElement.id === "menu-metas") { - console.log("a"); node.firstElementChild.onclick = function () { if (!node.classList.contains("active")) { for (const nodeOther of node.parentElement.children) { @@ -56,4 +55,19 @@ document.getElementById("sidebar-show").onclick = sidebarToggle; function sidebarToggle() { itemSidebar.parentElement.classList.toggle("show-sidebar"); } -sidebarToggle(); +if (window.innerWidth > 1000) { sidebarToggle(); } + + + +window.onload = function () { + + // 循环删除页面加载时css过度动画的效果抑制 + const elementsTranslationPreload = document.getElementsByClassName("prevent-animation"); + while (elementsTranslationPreload.length > 0) { + // console.debug("Removing translation-preload tag on element" + elementsTranslationPreload[0].nodeName + "#" + elementsTranslationPreload[0].id); + // console.debug("Last elements count is : " + elementsTranslationPreload.length); + elementsTranslationPreload[0].classList.remove("prevent-animation"); + } + console.debug("prevent-animation tag remove done"); + +} diff --git a/template/demo.html b/template/demo.html index 8ffd3f7..4f6d8e6 100644 --- a/template/demo.html +++ b/template/demo.html @@ -1,5 +1,5 @@ -