From 0faf077b255f219b7ec3e0b6a029c915a496fee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 10 Nov 2025 15:24:44 +0100 Subject: [PATCH] Improve login and hide background --- dashboard/app.js | 9 +++++++++ dashboard/index.html | 45 ++++++++++++++++++++++++----------------- plugin/evdashengine.cpp | 6 +++--- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/dashboard/app.js b/dashboard/app.js index 3e12043..7f1b5d9 100644 --- a/dashboard/app.js +++ b/dashboard/app.js @@ -421,6 +421,7 @@ class DashboardApp { } showLoginOverlay(message) { + this.setAuthLayout(true); if (this.elements.loginOverlay) this.elements.loginOverlay.classList.remove('hidden'); if (typeof message === 'string' && message.length > 0) @@ -433,6 +434,7 @@ class DashboardApp { } hideLoginOverlay() { + this.setAuthLayout(false); if (this.elements.loginOverlay) this.elements.loginOverlay.classList.add('hidden'); this.hideLoginError(); @@ -465,6 +467,13 @@ class DashboardApp { return `req-${Date.now()}-${Math.random().toString(16).slice(2)}`; } + + setAuthLayout(requireAuth) { + const body = document.body; + if (!body) + return; + body.classList.toggle('needs-auth', requireAuth); + } } window.app = new DashboardApp(); diff --git a/dashboard/index.html b/dashboard/index.html index 3b818bf..2a64a08 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -131,30 +131,37 @@ color: var(--muted-text-color); } - /* Login overlay */ - .overlay { - position: fixed; - inset: 0; - background: rgba(31, 45, 61, 0.65); - display: flex; - align-items: center; - justify-content: center; - padding: 1.5rem; - transition: opacity 0.3s ease; + /* Authentication view */ + body.needs-auth { + background: var(--surface-color); } - .overlay.hidden { - visibility: hidden; - opacity: 0; - pointer-events: none; + body.needs-auth header, + body.needs-auth main, + body.needs-auth footer { + display: none; + } + + .login-view { + width: 100%; + padding: 3rem 1.5rem; + display: none; + } + + body.needs-auth .login-view { + display: flex; + flex: 1; + align-items: center; + justify-content: center; } .login-panel { background: var(--surface-color); width: min(420px, 100%); border-radius: 16px; - padding: 2rem; - box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18); + padding: 2.25rem; + border: 1px solid rgba(0, 0, 0, 0.06); + box-shadow: 0 18px 28px rgba(0, 0, 0, 0.08); } .login-panel h2 { @@ -242,7 +249,7 @@ } - +

nymea EV Dash

@@ -277,7 +284,7 @@ -

+