From bf0a57609d3792863c1f20a9d2d4b5bd7b0c7576 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 25 Jun 2023 00:31:43 +0200 Subject: refactor + animate sidebar --- client-web/source/menu.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client-web/source/menu.ts') diff --git a/client-web/source/menu.ts b/client-web/source/menu.ts index 041dcdf..3d023e2 100644 --- a/client-web/source/menu.ts +++ b/client-web/source/menu.ts @@ -52,13 +52,13 @@ export function side_ui(container: HTMLElement, content: HTMLElement, label: str const checkbox = einput("checkbox", { onchange: () => { if (checkbox.checked) { - container.classList.add("animate-in") + content.classList.add("animate-in") container.appendChild(content) } else { - container.classList.remove("animate-in") - container.classList.add("animate-out") + content.classList.remove("animate-in") + content.classList.add("animate-out") setTimeout(() => { // TODO breaks if ui is being enabled while timeout is active - container.classList.remove("animate-out") + content.classList.remove("animate-out") container.removeChild(content) }, 400) } -- cgit v1.2.3-70-g09d2