feat: scan page redesign — fixed 2x zoom, torch, camera flip, tabs, recents, AI number OCR

- Always-on 2x hardware zoom (CSS scale fallback)
- Torch button with toggle + visual feedback
- Camera flip (front/back) with settings persistence
- 3-tab input panel: Barcode / Name / AI
- Recent products chips (last 6 scanned, from localStorage)
- Live barcode code overlay during partial detection
- Confirm overlay (checkmark + name) on successful scan
- AI number OCR (Gemini reads barcode digits from image, shown after 4s)
- Guide corners frame in viewport
- PHP: gemini_number_ocr action + rate-limited
- Translations: new scan.* keys in it/en/de
This commit is contained in:
dadaloop82
2026-05-12 14:55:14 +00:00
parent 27ba41700f
commit 696a9c6d11
7 changed files with 613 additions and 157 deletions
+17 -1
View File
@@ -170,10 +170,26 @@
"qty_trace": "< 1"
},
"scan": {
"title": "Produkt scannen",
"title": "Scannen",
"mode_shopping": "🛒 Einkaufsmodus",
"mode_shopping_end": "✅ Einkauf beenden",
"spesa_btn": "🛒 Einkauf",
"zoom": "Zoom",
"tab_barcode": "Barcode",
"tab_name": "Name",
"tab_ai": "KI",
"recents_label": "Zuletzt",
"torch_hint": "Taschenlampe",
"torch_on": "Taschenlampe an",
"torch_off": "Taschenlampe aus",
"torch_unavailable": "Taschenlampe auf diesem Gerät nicht verfügbar",
"flip_hint": "Kamera wechseln",
"flip_front": "Frontkamera",
"flip_back": "Rückkamera",
"num_ocr_btn": "🔢 Zahlen mit KI lesen",
"num_ocr_searching": "Suche Barcode mit KI...",
"num_ocr_found": "Code gefunden: {code}",
"num_ocr_not_found": "Kein Barcode im Bild gefunden",
"barcode_placeholder": "Barcode eingeben...",
"quick_name_divider": "oder Name eingeben",
"quick_name_placeholder": "z.B.: Äpfel, Zucchini, Brot...",
+17 -1
View File
@@ -170,10 +170,26 @@
"qty_trace": "< 1"
},
"scan": {
"title": "Scan Product",
"title": "Scan",
"mode_shopping": "🛒 Shopping Mode",
"mode_shopping_end": "✅ End shopping",
"spesa_btn": "🛒 Shopping",
"zoom": "Zoom",
"tab_barcode": "Barcode",
"tab_name": "Name",
"tab_ai": "AI",
"recents_label": "Recent",
"torch_hint": "Torch",
"torch_on": "Torch on",
"torch_off": "Torch off",
"torch_unavailable": "Torch not available on this device",
"flip_hint": "Flip camera",
"flip_front": "Front camera",
"flip_back": "Rear camera",
"num_ocr_btn": "🔢 Read numbers with AI",
"num_ocr_searching": "Looking for barcode with AI...",
"num_ocr_found": "Code found: {code}",
"num_ocr_not_found": "No barcode found in image",
"barcode_placeholder": "Enter barcode...",
"quick_name_divider": "or type the name",
"quick_name_placeholder": "E.g.: Apples, Zucchini, Bread...",
+17 -1
View File
@@ -170,10 +170,26 @@
"qty_trace": "< 1"
},
"scan": {
"title": "Scansiona Prodotto",
"title": "Scansiona",
"mode_shopping": "🛒 Modalità Spesa",
"mode_shopping_end": "✅ Fine spesa",
"spesa_btn": "🛒 Spesa",
"zoom": "Zoom",
"tab_barcode": "Barcode",
"tab_name": "Nome",
"tab_ai": "AI",
"recents_label": "Recenti",
"torch_hint": "Torcia",
"torch_on": "Torcia accesa",
"torch_off": "Torcia spenta",
"torch_unavailable": "Torcia non disponibile su questo dispositivo",
"flip_hint": "Cambia fotocamera",
"flip_front": "Fotocamera anteriore",
"flip_back": "Fotocamera posteriore",
"num_ocr_btn": "🔢 Leggi numeri con AI",
"num_ocr_searching": "Cerco il codice con AI...",
"num_ocr_found": "Codice trovato: {code}",
"num_ocr_not_found": "Nessun codice trovato nell'immagine",
"barcode_placeholder": "Inserisci codice a barre...",
"quick_name_divider": "oppure scrivi il nome",
"quick_name_placeholder": "Es: Mele, Zucchine, Pane...",