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