From 14f77d413d7a1d1e7d087fdb2c201387f7c9c381 Mon Sep 17 00:00:00 2001 From: Autumn Date: Sat, 16 May 2026 08:48:08 +0100 Subject: [pages] added mobile styling --- src/public/css/dashboard.css | 78 ++++++++++++++++++++++++++++++++++- src/views/pages/dashboard/actions.pug | 9 ++-- src/views/pages/dashboard/devices.pug | 10 +++-- src/views/pages/dashboard/home.pug | 10 +++-- 4 files changed, 96 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/public/css/dashboard.css b/src/public/css/dashboard.css index 10b25ca..ca4f203 100644 --- a/src/public/css/dashboard.css +++ b/src/public/css/dashboard.css @@ -9,11 +9,23 @@ body { gap: 8px; } -h1 { - padding: 32px 0 16px 0; +section.heading { + padding: 32px 8px 16px 0; + display: flex; + flex-direction: row; + align-items: end; + justify-content: space-between; + + input { + width: 24px; + height: 24px; + display: none; + } } aside { + grid-row: 1; + grid-column: 1; background-color: var(--color-surface); border-top-right-radius: 12px; border-bottom-right-radius: 12px; @@ -46,8 +58,14 @@ aside { } } +main { + grid-row: 1; + grid-column: 2; +} + section.devices, section.actions { + padding-right: 8px; display: flex; flex-direction: column; gap: 2px; @@ -87,3 +105,59 @@ article.action { } } } + +@media (max-width: 600px) { + body { + grid-template-columns: auto; + } + + main { + grid-column: 1 / 3; + } + + section.heading { + padding-left: 12px; + padding-right: 12px; + + input { + display: initial; + } + } + + aside { + width: 100%; + position: absolute; + bottom: 0; + display: none; + border-top-left-radius: 16px; + border-top-right-radius: 16px; + border-bottom-right-radius: 0; + + ul { + padding: 12px; + gap: 4px; + + li a { + padding: 12px 16px; + } + } + } + + main:has(section.heading input:checked) + aside { + display: initial !important; + } + + section.devices, + section.actions { + padding-left: 8px; + } + + article.device, + article.action { + padding: 12px 24px; + + button { + padding: 8px 12px !important; + } + } +} diff --git a/src/views/pages/dashboard/actions.pug b/src/views/pages/dashboard/actions.pug index 9fa9086..7992d44 100644 --- a/src/views/pages/dashboard/actions.pug +++ b/src/views/pages/dashboard/actions.pug @@ -12,11 +12,13 @@ html body - include ../../components/dashboard/sidebar.pug - main - h1 Actions + section.heading + + h1 Actions + + input(type="checkbox") if !actions || actions.length < 1 @@ -30,3 +32,4 @@ html include ../../components/dashboard/action.pug + include ../../components/dashboard/sidebar.pug diff --git a/src/views/pages/dashboard/devices.pug b/src/views/pages/dashboard/devices.pug index f3605c0..a7253f8 100644 --- a/src/views/pages/dashboard/devices.pug +++ b/src/views/pages/dashboard/devices.pug @@ -12,11 +12,13 @@ html body - include ../../components/dashboard/sidebar.pug - main - h1 Devices + section.heading + + h1 Devices + + input(type="checkbox") if !devices || devices.length < 1 @@ -29,3 +31,5 @@ html each device in devices include ../../components/dashboard/device.pug + + include ../../components/dashboard/sidebar.pug diff --git a/src/views/pages/dashboard/home.pug b/src/views/pages/dashboard/home.pug index 8ae2c4b..3bbd810 100644 --- a/src/views/pages/dashboard/home.pug +++ b/src/views/pages/dashboard/home.pug @@ -12,8 +12,12 @@ html body - include ../../components/dashboard/sidebar.pug - main - h1 Home Control + section.heading + + h1 Home Control + + input(type="checkbox") + + include ../../components/dashboard/sidebar.pug -- cgit v1.3