Added QR Scanner to more input fields
This commit is contained in:
17
app/views/layouts/_scanner.html.erb
Normal file
17
app/views/layouts/_scanner.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- (HINWEIS: Hier im Untergrund muss noch dein HTML-Modal für die Kamera-Vorschau liegen, falls das nicht global eingebunden ist) -->
|
||||
<div data-scanner-target="modal" class="hidden fixed inset-0 bg-gray-900/60 z-50 flex items-center justify-center p-4 backdrop-blur-sm">
|
||||
<div class="bg-white rounded-2xl max-w-md w-full p-6 space-y-4 shadow-xl border border-gray-100">
|
||||
<div class="flex justify-between items-center">
|
||||
<h3 class="text-sm font-bold text-gray-800 uppercase tracking-wide">QR-Code scannen</h3>
|
||||
<button type="button" data-action="click->scanner#stopCamera" class="p-1 text-gray-400 hover:text-gray-600 rounded-lg">
|
||||
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- DAS VORSCHAUFENSTER FÜR DIE KAMERA IN DEINER _search_bar.html.erb -->
|
||||
<!-- KORREKTUR: Das Video-Tag steht jetzt fest im HTML und dient direkt als Target -->
|
||||
<div class="w-full aspect-square rounded-xl overflow-hidden border border-gray-200 bg-black flex items-center justify-center">
|
||||
<video data-scanner-target="preview" class="w-full h-full object-cover rounded-xl" playsinline muted></video>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 text-center">Halte den QR-Code des Geräts ruhig in den Scan-Rahmen.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,6 +137,7 @@
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Globaler Platzhalter für das optionale Turbo-Frame-Modal (z.B. neue Personen anlegen) -->
|
||||
<%= turbo_frame_tag "modal" %>
|
||||
|
||||
Reference in New Issue
Block a user