1
0
mirror of https://github.com/suk-ws/ph-Bookshelf.git synced 2024-12-05 09:26:52 +08:00

初次加载的菜单动画抑制,按钮图标框选抑制

This commit is contained in:
A.C.Sukazyo Eyre 2021-11-22 18:09:29 +08:00
parent df53442022
commit 669c3034a3
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 24 additions and 4 deletions

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<? require_once "./src/Data/SiteMeta.php"; ?>
<div id="nav-container"><nav id="sidebar">
<div id="nav-container" class="prevent-animation"><nav id="sidebar">
<noscript id="noscript-warn">For now, javascript must be enabled to view this site!!</noscript>
<address id="site-title">ph-Bookshelf BEDROCK Demo supports looooooooog title</address>
<div id="menu-container" class="menu-container sidebar-card">
@ -68,7 +68,8 @@
</a>
<a class="no-style menu-item" href="https://github.com/suk-ws/ph-Bookshelf" target="_blank">
<span>published with ph-Bookshelf</span><br>
<small><?=SiteMeta::getProgramVersion()?></small>
<small><?=SiteMeta::getProgramVersion()?></small><br>
<small>with BreadCardUI</small>
</a>
</div>
</div>