diff --git a/.gitignore b/.gitignore index b668c57..797621e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ # Fresh build directory /_fresh /db -/.react-email \ No newline at end of file +/.react-email +/temp \ No newline at end of file diff --git a/islands/events/scanning.tsx b/islands/events/scanning.tsx index 9faa713..4a38052 100644 --- a/islands/events/scanning.tsx +++ b/islands/events/scanning.tsx @@ -5,6 +5,7 @@ import { BarcodeDetector, DetectedBarcode } from "npm:barcode-detector"; import { Ticket } from "@/utils/db/kv.types.ts"; import { useSignal } from "@preact/signals"; import Dropdown from "../components/pickers/dropdown.tsx"; +import CameraRotate from "$tabler/camera-rotate.tsx"; export default function Scanner({ className, @@ -160,6 +161,8 @@ export default function Scanner({ } }; + let targetCodeCoords: { x: number; y: number } | null = null; + const lookForBarcodes = async () => { const codes = await reader.detect(video); if (codes.length > 0) { @@ -308,25 +311,40 @@ export default function Scanner({ height={1080} /> {error.value} -
+
+ {/* Camera switching */} +
+ {cameraIds.value.length === 1 || + (true && ( + + ))} + {cameraIds.value.length > 2 && false && ( + ({ + content: label, + onClick: () => { + if (currentCamera.value == deviceId) return; + currentCamera.value = deviceId; + }, + }))} + > +

Market pire

+
+ )} +
+ + {/* Ticket scanning bit */}
- Bring a ticket code into view + Bring code into view
- ({ - content: label, - onClick: () => { - if (currentCamera.value == deviceId) return; - currentCamera.value = deviceId; - }, - }))} - > -

Market pire

-
);