From 8248e0cd914b7d061f60990770d8be24ead06e77 Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Thu, 29 Jan 2026 15:27:51 +0100 Subject: [PATCH] feat(03-03): CameraCapture modal with getUserMedia - Full-screen camera modal with live preview via getUserMedia - Photo capture using canvas.toBlob (JPEG at 0.9 quality) - Preview captured photo with retake/confirm flow - Camera stream properly stopped on close and after capture - Switch camera button for front/back camera toggle - Upload integration via ?/uploadImage form action Co-Authored-By: Claude Opus 4.5 --- src/lib/components/CameraCapture.svelte | 313 ++++++++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 src/lib/components/CameraCapture.svelte diff --git a/src/lib/components/CameraCapture.svelte b/src/lib/components/CameraCapture.svelte new file mode 100644 index 0000000..9989b54 --- /dev/null +++ b/src/lib/components/CameraCapture.svelte @@ -0,0 +1,313 @@ + + +
+ +
+ + + {#if !error && !capturedPreviewUrl} + + {/if} +
+ + +
+ {#if error} +
+

{error}

+ +
+ {:else if capturedPreviewUrl} + + Captured photo preview + {:else} + + + + {/if} +
+ + + + + +
+ {#if capturedPreviewUrl} + + + + {:else if !error} + + + {/if} +
+