diff --git a/src/routes/more/reg/submit/+page.svelte b/src/routes/more/reg/submit/+page.svelte index 4e23318..73a15a7 100644 --- a/src/routes/more/reg/submit/+page.svelte +++ b/src/routes/more/reg/submit/+page.svelte @@ -7,37 +7,11 @@ const title = "Submit Registration"; let state = false; let status: string; - - let inputs: { id: string; value: string }[] = [ - { id: "1", value: "" }, - { id: "2", value: "" }, - { id: "3", value: "" }, - { id: "4", value: "" }, - { id: "5", value: "" }, - { id: "6", value: "" }, - ]; - - function handleInput(index: number, event: KeyboardEvent): void { - if (event.key === "Backspace" && index > 0 && inputs[index].value === "") { - const prevInput = document.getElementById(`input-${index}`); - if (prevInput) { - prevInput.focus(); - } - } else if (inputs[index].value.length === 1) { - const nextInput = document.getElementById(`input-${index + 2}`); - if (nextInput) { - nextInput.focus(); - } - } - } + let inputString: string; async function handleSubmit() { - let submitString: string = ""; - for (const input of inputs) { - submitString += input.value.toUpperCase(); - } - console.log(`Code: ${submitString}`); - const res = await submit(submitString); + console.log(`Code: ${inputString}`); + const res = await submit(inputString); console.log(`Registration Status: ${res}`); if (res == 201) { status = "okay"; @@ -85,9 +59,7 @@ {:else}
Enter your registration code below
@@ -102,7 +74,7 @@ .code-in { margin: 3px; margin-bottom: 20px; - width: 29px; + width: calc(29px * 6); height: 39px; font-size: 30px; text-align: center; diff --git a/src/routes/pis/+page.svelte b/src/routes/pis/+page.svelte index 0aed748..a64246a 100644 --- a/src/routes/pis/+page.svelte +++ b/src/routes/pis/+page.svelte @@ -73,9 +73,11 @@ } onMount(() => { - toast("Registration soon required for PIS features.\n\nClick 'Register' in the menu.", { + if ($uuid == null || $uuid == "") { + toast("This feature will soon require registration. Register in the menu.", { duration: 3000, }); + } }); const resultsCard: CardConfig = { diff --git a/src/routes/train/+page.svelte b/src/routes/train/+page.svelte index ca7767a..af5b452 100644 --- a/src/routes/train/+page.svelte +++ b/src/routes/train/+page.svelte @@ -48,10 +48,11 @@ id = (await getHeadcode()) || ""; load(); - toast("Registration soon required for timetable features.\n\nClick 'Register' in the menu.", { + if ($uuid == null || $uuid == "") { + toast("PIS Codes will soon be hidden for unregistered users. Register in the menu.", { duration: 3000, }); - + } }); function load() { @@ -70,7 +71,7 @@ { loading: 'Searching Timetable', success: 'Done', - error: 'Error' + error: 'No Services Found' } ) }