added ocr old logic
This commit is contained in:
@@ -44,12 +44,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
<canvas x-ref="canvas" width="320" height="240" class="hidden"></canvas>
|
||||
<img x-ref="snapshot" class="hidden border rounded max-w-full">
|
||||
|
||||
<div class="flex space-x-4 mt-2">
|
||||
<x-filament::button color="primary" @click="capturePhoto" x-show="!photoTaken">Capture</x-filament::button>
|
||||
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
||||
<x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-2 mt-2">
|
||||
<x-filament::button color="primary" @click="capturePhoto" x-show="!photoTaken">Capture</x-filament::button>
|
||||
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
||||
<x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="{{ $getName() }}" x-ref="hiddenInput">
|
||||
</div>
|
||||
@@ -99,6 +98,7 @@ function cameraCapture() {
|
||||
|
||||
snapshot.src = dataUrl;
|
||||
snapshot.classList.remove('hidden');
|
||||
video.classList.add('hidden');
|
||||
this.photoTaken = true;
|
||||
|
||||
this.$refs.hiddenInput.value = dataUrl;
|
||||
@@ -107,7 +107,7 @@ function cameraCapture() {
|
||||
async retakePhoto() {
|
||||
this.photoTaken = false;
|
||||
this.$refs.snapshot.classList.add('hidden');
|
||||
//this.$refs.video.classList.remove('hidden');
|
||||
this.$refs.video.classList.remove('hidden');
|
||||
await this.initCamera();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user