From 3dc09131ddc394fd6ea0c7cce08030428547a84e Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Wed, 18 Sep 2024 15:01:09 +0100 Subject: [PATCH] collapse menu on mobile --- src/ui/menu.ts | 5 +++++ src/ui/scene-panel.scss | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ui/menu.ts b/src/ui/menu.ts index b60ef8d0..28805e3b 100644 --- a/src/ui/menu.ts +++ b/src/ui/menu.ts @@ -72,6 +72,11 @@ class Menu extends Container { }; + // collapse menu on mobile + if (document.body.clientWidth < 600) { + toggleCollapsed(); + } + const collapse = createSvg(collapseSvg); collapse.dom.classList.add('menu-icon'); collapse.dom.setAttribute('id', 'menu-collapse'); diff --git a/src/ui/scene-panel.scss b/src/ui/scene-panel.scss index 80d7119e..727a595e 100644 --- a/src/ui/scene-panel.scss +++ b/src/ui/scene-panel.scss @@ -4,12 +4,6 @@ width: 320px; } -@media (max-width: 600px) { - #scene-panel { - display: none; - } -} - .collapsed #scene-panel { display: none; } \ No newline at end of file