diff --git a/frontend/src/lib/components/layout/SplitLayout.svelte b/frontend/src/lib/components/layout/SplitLayout.svelte index 3669c24..953bfaa 100644 --- a/frontend/src/lib/components/layout/SplitLayout.svelte +++ b/frontend/src/lib/components/layout/SplitLayout.svelte @@ -44,7 +44,7 @@ } .view { @apply z-10 overflow-scroll; - @apply rounded-lg md:rounded-none; + @apply rounded-3xl md:rounded-none; @apply absolute w-[90vw] h-[85vh] top-0 md:top-auto right-0 bottom-0 md:bottom-auto left-0 md:left-auto m-auto md:m-0; @apply md:w-[50vw] md:h-screen; @apply md:my-auto; diff --git a/frontend/src/routes/login/+page.svelte b/frontend/src/routes/login/+page.svelte index ed07626..a9c08b9 100644 --- a/frontend/src/routes/login/+page.svelte +++ b/frontend/src/routes/login/+page.svelte @@ -1,6 +1,17 @@ @@ -15,11 +26,13 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Fusce suscipit libero eget elit.

.form { - @apply flex flex-col; @apply mx-auto w-[90%] h-full; @apply items-center justify-center; diff --git a/frontend/src/routes/login/[code=application]/+page.svelte b/frontend/src/routes/login/[code=application]/+page.svelte index 673ecf7..a5837a1 100644 --- a/frontend/src/routes/login/[code=application]/+page.svelte +++ b/frontend/src/routes/login/[code=application]/+page.svelte @@ -4,18 +4,37 @@ import woman from '$lib/assets/woman.png'; import { onMount } from 'svelte'; + let codeValueMobile: string = ''; let codeValueArray: Array = []; let codeElementArray: Array = []; - const inputOnKeyDown = (index: number, e: KeyboardEvent) => { + const inputMobileOnKeyDown = (event: KeyboardEvent) => { + let input = event.target as HTMLInputElement; + if (input.value.length > 8) { + input.value = input.value.slice(0, 8); + } + + let splittedInput = input.value.split(''); + + codeValueArray = splittedInput; + }; + + const inputDesktopOnKeyDown = (index: number, e: KeyboardEvent) => { if (e.key === 'Backspace') { codeValueArray[index] = ''; + if (codeElementArray[index - 1]) { + codeElementArray[index - 1].focus(); + } } else { + if (e.key.length > 1) { + return; + } codeValueArray[index] = e.key; if (codeElementArray[index + 1]) { codeElementArray[index + 1].focus(); } } + codeValueMobile = codeValueArray.join(''); }; onMount(() => { @@ -26,39 +45,37 @@