From f3f43ae68ec7577499ca47acbfa054dafb8d6877 Mon Sep 17 00:00:00 2001 From: Ole Date: Sun, 14 Jun 2026 18:25:00 +0200 Subject: [PATCH] =?UTF-8?q?Scan-Feedback=20entfernt=20+=20dontInvert=20zur?= =?UTF-8?q?=C3=BCck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 14 ++------------ style.css | 10 ---------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/app.js b/app.js index 1454e49..d3868ce 100644 --- a/app.js +++ b/app.js @@ -82,7 +82,6 @@ /* ─── Camera ─── */ let camStream = null; let camRaf = null; - let camVideoEl = null; async function camStart(videoId) { await camStop(); @@ -103,7 +102,6 @@ } camStream = stream; const v = $(videoId); - camVideoEl = v; v.srcObject = stream; v.setAttribute('playsinline', ''); v.classList.add('active'); @@ -116,7 +114,6 @@ } function camStop() { - if (camVideoEl) { camVideoEl.classList.remove('scan-active', 'scan-done'); camVideoEl = null; } if (camRaf) { cancelAnimationFrame(camRaf); camRaf = null; } if (camStream) { camStream.getTracks().forEach(t => t.stop()); camStream = null; } } @@ -126,7 +123,6 @@ const c = $(canvasId); const ctx = c.getContext('2d', { willReadFrequently: true }); let lastScan = 0; - v.classList.add('scan-active'); const detect = barcodeDetector ? async () => { @@ -137,7 +133,7 @@ c.width = v.videoWidth; c.height = v.videoHeight; ctx.drawImage(v, 0, 0); const img = ctx.getImageData(0, 0, c.width, c.height); - const code = jsQR(img.data, img.width, img.height, { inversionAttempts: 'attemptBoth' }); + const code = jsQR(img.data, img.width, img.height, { inversionAttempts: 'dontInvert' }); return code ? code.data : null; }; @@ -150,13 +146,7 @@ if (raw) { const bytes = decode45(raw); const p = await unpack(bytes); - if (p.v === 1) { - v.classList.remove('scan-active'); - v.classList.add('scan-done'); - setTimeout(() => v.classList.remove('scan-done'), 600); - callback(p, raw); - return; - } + if (p.v === 1) { callback(p, raw); return; } } } catch (_) {} camRaf = requestAnimationFrame(tick); diff --git a/style.css b/style.css index 8348883..096c288 100644 --- a/style.css +++ b/style.css @@ -192,15 +192,6 @@ h3 { max-width: 320px; border-radius: var(--radius); border: 2px solid var(--border); - transition: border-color 0.15s, box-shadow 0.15s; -} -video.scan-active { - border-color: #ff4444 !important; - box-shadow: 0 0 12px rgba(255,68,68,0.4); -} -video.scan-done { - border-color: #44ff44 !important; - box-shadow: 0 0 12px rgba(68,255,68,0.4); } /* Protocol status */ @@ -350,7 +341,6 @@ video.scan-done { border-radius: var(--radius); display: none; margin: 8px auto; - transition: border-color 0.15s, box-shadow 0.15s; } #host-camera.active { display: block;