aboutsummaryrefslogtreecommitdiff
path: root/client-web/source
diff options
context:
space:
mode:
Diffstat (limited to 'client-web/source')
-rw-r--r--client-web/source/menu.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/client-web/source/menu.ts b/client-web/source/menu.ts
index 1b159ec..041dcdf 100644
--- a/client-web/source/menu.ts
+++ b/client-web/source/menu.ts
@@ -51,8 +51,17 @@ export function side_ui(container: HTMLElement, content: HTMLElement, label: str
// TODO: close other side uis
const checkbox = einput("checkbox", {
onchange: () => {
- if (checkbox.checked) container.appendChild(content)
- else container.removeChild(content)
+ if (checkbox.checked) {
+ container.classList.add("animate-in")
+ container.appendChild(content)
+ } else {
+ container.classList.remove("animate-in")
+ container.classList.add("animate-out")
+ setTimeout(() => { // TODO breaks if ui is being enabled while timeout is active
+ container.classList.remove("animate-out")
+ container.removeChild(content)
+ }, 400)
+ }
}
})
return {