opt: reduce code

This commit is contained in:
KOWX712
2025-03-02 04:06:17 +08:00
parent 93e2e8c8ba
commit c20e8cde1f
15 changed files with 156 additions and 343 deletions

View File

@@ -1,21 +1,18 @@
const helpButton = document.getElementById('help-button');
const helpOverlay = document.getElementById('help-overlay');
const closeHelp = document.getElementById('close-help');
const helpList = document.getElementById('help-list');
// Open help menu
helpButton.addEventListener("click", () => {
helpOverlay.classList.remove("hide");
helpOverlay.style.display = "flex";
requestAnimationFrame(() => {
helpOverlay.classList.add("show");
});
document.body.classList.add("no-scroll");
helpOverlay.style.display = "flex";
setTimeout(() => {
helpOverlay.style.opacity = 1;
}, 10);
});
const hideHelpOverlay = () => {
helpOverlay.classList.remove("show");
helpOverlay.classList.add("hide");
helpOverlay.style.opacity = 0;
document.body.classList.remove("no-scroll");
setTimeout(() => {
helpOverlay.style.display = "none";