From f7cedf24e843337ddd73636e1c942d5a19b325c3 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Sun, 18 Jan 2026 10:59:08 +0100 Subject: [PATCH] shared website header Signed-off-by: Peter Siegmund --- firmware/storage/www/captive.html | 12 ----- firmware/storage/www/css/captive.css | 67 ++++++++++++++------------ firmware/storage/www/css/index.css | 4 -- firmware/storage/www/css/shared.css | 57 ++++++++++++++++++++++ firmware/storage/www/index.html | 7 ++- firmware/storage/www/js/wifi-shared.js | 15 ++++++ 6 files changed, 114 insertions(+), 48 deletions(-) diff --git a/firmware/storage/www/captive.html b/firmware/storage/www/captive.html index 4e03a2f..9e17dbe 100644 --- a/firmware/storage/www/captive.html +++ b/firmware/storage/www/captive.html @@ -114,18 +114,6 @@ updateConnectBtn(); }); - // Toggle password visibility - function togglePassword() { - const input = document.getElementById('password'); - const btn = document.getElementById('password-btn'); - if (input.type === 'password') { - input.type = 'text'; - btn.textContent = 'πŸ™ˆ'; - } else { - input.type = 'password'; - btn.textContent = 'πŸ‘οΈ'; - } - } diff --git a/firmware/storage/www/css/captive.css b/firmware/storage/www/css/captive.css index 31c9e33..a0b6cb9 100644 --- a/firmware/storage/www/css/captive.css +++ b/firmware/storage/www/css/captive.css @@ -1,29 +1,57 @@ +@media (max-width: 600px) { + .header { + flex-direction: row; + align-items: flex-start; + text-align: left; + } + + .header h1 { + flex: 1 1 100%; + text-align: center; + order: 2; + margin-top: 8px; + } + + .header-controls { + order: 1; + flex: 1 1 auto; + justify-content: flex-start; + display: flex; + gap: 8px; + } +} + /* Captive Portal CSS - WiFi setup specific styles */ /* Base styles are in shared.css */ + body { - padding: 16px; - display: flex; - align-items: center; - justify-content: center; + padding: 12px; } .container { + max-width: 900px; + margin: 0 auto; width: 100%; - max-width: 400px; } /* Header */ + .header { - text-align: center; - margin-bottom: 24px; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + flex-wrap: wrap; + gap: 10px; } .header h1 { - font-size: 1.4rem; - margin-bottom: 8px; + font-size: 1.5rem; + margin: 0; } + .header p { color: var(--text-muted); font-size: 0.9rem; @@ -163,27 +191,6 @@ select { font-size: 1.1rem; } -/* Password Toggle */ -.password-toggle { - position: relative; -} - -.password-toggle input { - padding-right: 50px; -} - -.password-toggle button { - position: absolute; - right: 12px; - top: 50%; - transform: translateY(-50%); - background: none; - border: none; - color: var(--text-muted); - font-size: 1.2rem; - cursor: pointer; - padding: 4px; -} /* Info Box */ .info-box { diff --git a/firmware/storage/www/css/index.css b/firmware/storage/www/css/index.css index a739e9e..84592c4 100644 --- a/firmware/storage/www/css/index.css +++ b/firmware/storage/www/css/index.css @@ -20,10 +20,6 @@ body { gap: 10px; } -.header h1 { - font-size: 1.5rem; - margin: 0; -} .form-group { margin-bottom: 12px; diff --git a/firmware/storage/www/css/shared.css b/firmware/storage/www/css/shared.css index a8d4db9..8106d2c 100644 --- a/firmware/storage/www/css/shared.css +++ b/firmware/storage/www/css/shared.css @@ -1,3 +1,60 @@ +/* Passwortfeld Toggle (zentral fΓΌr alle Seiten) */ +.password-toggle { + position: relative; + display: flex; + align-items: center; + gap: 0; +} + +.password-toggle input { + padding-right: 50px; + flex: 1; +} + +.password-toggle button { + position: absolute; + right: 12px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + color: var(--text-muted); + font-size: 1.2rem; + cursor: pointer; + padding: 4px; + transition: color 0.2s; +} + +.password-toggle button:active { + color: var(--accent); +} + +/* Passwortfeld Toggle */ +.password-toggle { + display: flex; + align-items: center; + gap: 6px; +} + +.password-toggle input[type="password"], +.password-toggle input[type="text"] { + flex: 1; +} + +.password-toggle button { + background: none; + border: none; + font-size: 1.2em; + cursor: pointer; + color: var(--text-muted); + padding: 0 6px; + transition: color 0.2s; +} + +.password-toggle button:active { + color: var(--accent); +} + /* Shared CSS - Base styles for all pages */ /* CSS Variables - Dark Mode (default) */ diff --git a/firmware/storage/www/index.html b/firmware/storage/www/index.html index 6038ccf..cf8cfa1 100644 --- a/firmware/storage/www/index.html +++ b/firmware/storage/www/index.html @@ -162,8 +162,11 @@
- +
+ + +
diff --git a/firmware/storage/www/js/wifi-shared.js b/firmware/storage/www/js/wifi-shared.js index 20e5b71..91ce6c8 100644 --- a/firmware/storage/www/js/wifi-shared.js +++ b/firmware/storage/www/js/wifi-shared.js @@ -1,3 +1,18 @@ +/** + * Passwortfeld sichtbar/unsichtbar schalten (shared) + */ +function togglePassword() { + const input = document.getElementById('password'); + const btn = document.getElementById('password-btn'); + if (!input || !btn) return; + if (input.type === 'password') { + input.type = 'text'; + btn.textContent = 'πŸ™ˆ'; + } else { + input.type = 'password'; + btn.textContent = 'πŸ‘οΈ'; + } +} // Shared WiFi configuration functions // Used by both captive.html and index.html