+
Card Assignment for Mobile
+ {#if state === "done"}
+
Assigned Card {cardInfo} ✅
+
(not really, needs to be implemented)
+ {:else}
+
+ {#if state === "scan_runner"}
+
Scan Runner (Selfservice QR)
+ {/if}
+ {#if state === "scan_card"}
+
Runner Scanned
+
{runnerID}
+
Scan Card (Code 128 Barcode)
+ {/if}
+
{
+ console.log({ type: "DETECT", code: e.detail.decodedText });
+ if (state === "scan_runner") {
+ if (
+ e.detail.decodedText.includes(
+ "https://portal.lauf-fuer-kaya.de/profile/"
+ )
+ ) {
+ runnerID = JSON.parse(
+ atob(
+ e.detail.decodedText
+ .replace("https://portal.lauf-fuer-kaya.de/profile/", "")
+ .split(".")[1]
+ )
+ ).id;
+ state = "scan_card";
+ }
+ }
+ if (state === "scan_card") {
+ if (
+ !e.detail.decodedText.includes(
+ "https://portal.lauf-fuer-kaya.de/profile/"
+ )
+ ) {
+ cardInfo = e.detail.decodedText;
+ state = "done";
+ }
+ }
+ }}
+ width={320}
+ height={320}
+ class="w-full max-w-sm bg-neutral-300 rounded-lg overflow-hidden"
+ />
+ {#if state === "scan_card"}
+
+ {/if}
+
+ {/if}
+
diff --git a/src/components/general/QrCodeScanner.svelte b/src/components/general/QrCodeScanner.svelte
new file mode 100644
index 00000000..a0ca28e9
--- /dev/null
+++ b/src/components/general/QrCodeScanner.svelte
@@ -0,0 +1,80 @@
+
+
+