fix: key down
All checks were successful
Upload / Explore-Gitea-Actions (push) Successful in 52s

This commit is contained in:
moonlightwatch 2025-03-26 19:41:39 +08:00
parent a0fc627f8a
commit a86fa2da12

View File

@ -43,7 +43,6 @@
} }
.relocating { .relocating {
opacity: 0;
font-size: 13px; font-size: 13px;
transition: all .3s ease; transition: all .3s ease;
} }
@ -81,8 +80,8 @@
</div> </div>
</div> </div>
</div> </div>
<div class="relocating"> <div id="relocating" hidden>
跳转到: <span class="relocate-location"></span> 跳转到: <span id="relocate-location"></span>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
@ -93,12 +92,12 @@
var KEY_B = 66; var KEY_B = 66;
if (event.which === KEY_B) { if (event.which === KEY_B) {
document.getElementsByClassName("relocate-location").text('书签页'); document.getElementById("relocate-location").innerText = "书签页";
document.getElementsByClassName("relocating").css('opacity', 1); document.getElementById("relocating").hidden = false;
window.setTimeout(function () { window.setTimeout(function () {
document.getElementsByClassName("relocate-location").text(''); document.getElementById("relocate-location").innerText = "";
document.getElementsByClassName("relocating").css('opacity', 0); document.getElementById("relocating").hidden = true;
window.location.href = '/bookmarks.html'; window.location.href = '/bookmarks.html';
}, 1000); }, 1000);
} }