diff --git a/Views/Admin/Transport/SpjDriver/Scan/Index.cshtml b/Views/Admin/Transport/SpjDriver/Scan/Index.cshtml
index 36e5112..b291fd6 100644
--- a/Views/Admin/Transport/SpjDriver/Scan/Index.cshtml
+++ b/Views/Admin/Transport/SpjDriver/Scan/Index.cshtml
@@ -9,14 +9,8 @@
/* Html5-QRCode specific styles */
#scanner-container video {
width: 100% !important;
- height: 100% !impo if (this.html5QrCode && this.isScanning) {
- try {
- await this.html5QrCode.stop();
- } catch (error) {
- // Error stopping scanner
- }
- this.isScanning = false;
- } object-fit: cover !important;
+ height: 100% !important;
+ object-fit: cover !important;
border-radius: 8px;
}
@@ -34,21 +28,6 @@
#scanner-container button {
display: none !important;
}
-
- /* Custom scanner box overlay */
- #scanner-container::after {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 250px;
- height: 150px;
- border: 2px dashed rgba(255, 255, 255, 0.7);
- border-radius: 8px;
- pointer-events: none;
- z-index: 5;
- }
}
@@ -153,10 +132,10 @@
Tips Scanning:
- - • Pastikan barcode dalam pencahayaan yang cukup
+ - • Pastikan QR code dalam pencahayaan yang cukup
- • Jaga jarak 15-30cm dari kamera
- - • Arahkan kamera secara tegak lurus ke barcode
- - • Pastikan barcode tidak buram atau rusak
+ - • Arahkan kamera secara tegak lurus ke QR code
+ - • Pastikan QR code tidak buram atau rusak
- • Klik "Izinkan/Allow" saat browser meminta akses kamera
@@ -185,7 +164,7 @@
- Barcode terdeteksi!
+ QR Code terdeteksi!
Kode:
@@ -335,13 +314,22 @@
cameraId = backCamera.id;
}
- // Start scanning
+ // Start scanning with square QR code focus
await this.html5QrCode.start(
cameraId,
{
fps: 10, // Frame per second
- qrbox: { width: 250, height: 150 }, // Scanning area
- aspectRatio: 1.7, // Width/height ratio
+ qrbox: function(viewfinderWidth, viewfinderHeight) {
+ // Make it square - use the smaller dimension
+ let minEdgePercentage = 0.7; // 70% of the smaller edge
+ let minEdgeSize = Math.min(viewfinderWidth, viewfinderHeight);
+ let qrboxSize = Math.floor(minEdgeSize * minEdgePercentage);
+ return {
+ width: qrboxSize,
+ height: qrboxSize
+ };
+ },
+ aspectRatio: 1.0, // Square ratio for QR codes
rememberLastUsedCamera: true
},
(decodedText, decodedResult) => {