From 1942c2bb353fc260811c1840ab3f971556cb5b1f Mon Sep 17 00:00:00 2001 From: cclohmar Date: Thu, 6 Aug 2026 17:50:16 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20clean=20settings=20cards=20=E2=80=94=20?= =?UTF-8?q?name=20+=20desc,=20advanced=20collapsed,=20add/remove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/app.js | 36 +++++++++++++++++++----------------- public/style.css | 5 +++++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/public/app.js b/public/app.js index 7820108..0d7346d 100644 --- a/public/app.js +++ b/public/app.js @@ -280,39 +280,41 @@ async function renderCameraCards() { -
+
${cameras.length} camera(s)
` + cameras.map((c, i) => `
-

📷 ${c.name || 'Unnamed'} ${c.ip} - ⚙️ Config - -

-
-

📷 ${c.name || 'Unnamed'} ${c.ip} - ⚙️ Config +

📷 ${c.name || 'Camera_' + c.ip.split('.').pop()} + ${c.ip}

- - - - - -
- - + +
+ + + +
+
`).join(''); } // ── Settings: Add / Remove cameras ── -function addCamera() { +function toggleAdv(btn) { + const adv = btn.parentElement.parentElement.querySelector('.advanced'); + adv.classList.toggle('hidden'); + btn.textContent = adv.classList.contains('hidden') ? '▸ Advanced' : '▾ Advanced'; +} const ip = prompt('Camera IP address:', '192.168.1.'); if (!ip) return; const id = 'cam_' + ip.split('.').pop(); diff --git a/public/style.css b/public/style.css index c2a9530..82141e2 100644 --- a/public/style.css +++ b/public/style.css @@ -164,6 +164,11 @@ body { .camera-card textarea { resize: vertical; min-height: 50px; } .camera-card .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; } .camera-card .row label { margin-top: 0; } +.camera-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; } +.advanced { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); } +.advanced.hidden { display: none; } +.btn-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; padding: 2px 6px; } +.btn-remove:hover { background: rgba(248,81,73,.15); border-radius: 4px; } .btn-primary { background: var(--accent); color: #fff; border: none; padding: 8px 20px; border-radius: var(--radius); cursor: pointer; font-size: 14px; } .btn-success { background: var(--green); color: #fff; border: none; padding: 8px 20px; border-radius: var(--radius); cursor: pointer; font-size: 14px; } .btn-primary:hover, .btn-success:hover { opacity: .9; }