Compare commits
No commits in common. "d3d0d17b3a99ab8412df3111dc2d4c029fd04908" and "710cad376eb865a0c82743a7213c3f4097027c23" have entirely different histories.
d3d0d17b3a
...
710cad376e
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
$: firstname = '';
|
$: firstname = '';
|
||||||
$: lastname = '';
|
$: lastname = '';
|
||||||
$: accepted = false;
|
|
||||||
$: showResult = false;
|
$: showResult = false;
|
||||||
$: showError = false;
|
$: showError = false;
|
||||||
|
|
||||||
@ -25,26 +24,23 @@
|
|||||||
showError = true;
|
showError = true;
|
||||||
showResult = false;
|
showResult = false;
|
||||||
}
|
}
|
||||||
firstname = '';
|
|
||||||
lastname = '';
|
|
||||||
accepted = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function textToBase64Barcode(text: string, is_qrcode: boolean) {
|
function textToBase64Barcode(text: string, is_qrcode: boolean) {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
let bcid = 'code128';
|
let bcid = 'ean13';
|
||||||
if (is_qrcode) {
|
if (is_qrcode) {
|
||||||
bcid = 'qrcode';
|
bcid = 'qrcode';
|
||||||
}
|
}
|
||||||
let codeconfig = {
|
let codeconfig = {
|
||||||
bcid,
|
bcid,
|
||||||
text: `${text}`,
|
text: `${text}`,
|
||||||
scale: 10,
|
scale: 4,
|
||||||
includetext: true,
|
includetext: true,
|
||||||
textxalign: 'center',
|
textxalign: 'center',
|
||||||
backgroundcolor: 'ffffff'
|
backgroundcolor: 'ffffff'
|
||||||
};
|
};
|
||||||
if (bcid == 'code128') {
|
if (bcid == 'ean13') {
|
||||||
codeconfig.height = 10;
|
codeconfig.height = 10;
|
||||||
}
|
}
|
||||||
bwipjs.toCanvas(canvas, codeconfig);
|
bwipjs.toCanvas(canvas, codeconfig);
|
||||||
@ -81,9 +77,8 @@
|
|||||||
bind:value={firstname}
|
bind:value={firstname}
|
||||||
aria-describedby="firstname-error"
|
aria-describedby="firstname-error"
|
||||||
/>
|
/>
|
||||||
<!-- <div
|
<div
|
||||||
class:hidden={firstname || firstname.length != 0}
|
class="hidden absolute inset-y-0 right-0 flex items-center pointer-events-none pr-3"
|
||||||
class="absolute inset-y-0 right-0 flex items-center pointer-events-none pr-3"
|
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="h-5 w-5 text-red-500"
|
class="h-5 w-5 text-red-500"
|
||||||
@ -97,15 +92,11 @@
|
|||||||
d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"
|
d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p
|
<p class="hidden text-xs text-red-600 mt-2" id="firstname-error">
|
||||||
class:hidden={firstname || firstname.length != 0}
|
|
||||||
class="text-xs text-red-600 mt-2"
|
|
||||||
id="firstname-error"
|
|
||||||
>
|
|
||||||
Bitte gebe deinen Vornamen ein
|
Bitte gebe deinen Vornamen ein
|
||||||
</p> -->
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- End Form Group -->
|
<!-- End Form Group -->
|
||||||
|
|
||||||
@ -122,9 +113,8 @@
|
|||||||
aria-describedby="lastname-error"
|
aria-describedby="lastname-error"
|
||||||
bind:value={lastname}
|
bind:value={lastname}
|
||||||
/>
|
/>
|
||||||
<!-- <div
|
<div
|
||||||
class:hidden={lastname || lastname.length != 0}
|
class="hidden absolute inset-y-0 right-0 flex items-center pointer-events-none pr-3"
|
||||||
class="absolute inset-y-0 right-0 flex items-center pointer-events-none pr-3"
|
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="h-5 w-5 text-red-500"
|
class="h-5 w-5 text-red-500"
|
||||||
@ -138,32 +128,21 @@
|
|||||||
d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"
|
d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p
|
<p class="hidden text-xs text-red-600 mt-2" id="lastname-error">
|
||||||
class:hidden={lastname || lastname.length != 0}
|
|
||||||
class="text-xs text-red-600 mt-2"
|
|
||||||
id="lastname-error"
|
|
||||||
>
|
|
||||||
Bitte gebe deinen Nachnamen ein
|
Bitte gebe deinen Nachnamen ein
|
||||||
</p> -->
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- End Form Group -->
|
<!-- End Form Group -->
|
||||||
|
|
||||||
<!-- Checkbox -->
|
<!-- Checkbox -->
|
||||||
<div
|
<div class="flex items-center">
|
||||||
class="flex items-center"
|
|
||||||
on:click={() => {
|
|
||||||
accepted = !accepted;
|
|
||||||
}}
|
|
||||||
on:keydown={() => {}}
|
|
||||||
>
|
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<input
|
<input
|
||||||
id="remember-me"
|
id="remember-me"
|
||||||
name="remember-me"
|
name="remember-me"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
bind:checked={accepted}
|
|
||||||
class="shrink-0 mt-0.5 border-gray-200 rounded text-blue-600 pointer-events-none focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"
|
class="shrink-0 mt-0.5 border-gray-200 rounded text-blue-600 pointer-events-none focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -180,39 +159,32 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!firstname || !lastname || !accepted}
|
class="py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"
|
||||||
class="py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold disabled:opacity-70 bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"
|
|
||||||
>Anmelden</button
|
>Anmelden</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<!-- End Form -->
|
<!-- End Form -->
|
||||||
{:else}
|
{:else}
|
||||||
<div class="mb-2">
|
<div>
|
||||||
<h3 class="text-xl font-semibold text-center dark:text-white">Läuferdaten</h3>
|
<p class="text-lg mb-2 dark:text-white">ID: {response.id}</p>
|
||||||
<p class="text-lg dark:text-white">ID: {response.id}</p>
|
<p class="text-lg mb-2 dark:text-white">Vorname: {response.firstname}</p>
|
||||||
<p class="text-lg dark:text-white">Vorname: {response.firstname}</p>
|
<p class="text-lg mb-2 dark:text-white">Nachname: {response.lastname}</p>
|
||||||
<p class="text-lg dark:text-white">Nachname: {response.lastname}</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-2 text-center">
|
<img
|
||||||
<h3 class="text-xl font-semibold dark:text-white">Läufercode</h3>
|
class="w-full md:w-auto mb-2 mx-auto"
|
||||||
<img
|
alt="Runnerid"
|
||||||
class="w-full md:w-auto mb-2 mx-auto bg-white p-4"
|
src={textToBase64Barcode(response.id.toString(), false)}
|
||||||
alt="Runnerid"
|
/>
|
||||||
src={textToBase64Barcode(response.id.toString(), false)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mx-auto text-center items-center">
|
<button
|
||||||
<button
|
on:click={() => {
|
||||||
on:click={() => {
|
showResult = false;
|
||||||
showResult = false;
|
}}
|
||||||
}}
|
class="py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"
|
||||||
class="w-full py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"
|
>Fertig</button
|
||||||
>Fertig</button
|
>
|
||||||
>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user