:Bug: Fixed gme-pin input
This commit is contained in:
@@ -79,7 +79,8 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$: if (game_pin.length >= 5) {
|
$: if (game_pin.length > 5) {
|
||||||
|
console.log('Setting game pin');
|
||||||
set_game_pin();
|
set_game_pin();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,6 +148,7 @@
|
|||||||
alert('Game not found');
|
alert('Game not found');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$: console.log(game_pin, game_pin.length > 6);
|
||||||
$: game_pin = game_pin.replace(/\D/g, '');
|
$: game_pin = game_pin.replace(/\D/g, '');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -161,14 +163,15 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
{#if game_pin === '' || game_pin.length <= 5}
|
{#if game_pin === '' || game_pin.length < 6}
|
||||||
<div class="flex flex-col justify-center align-center w-screen h-screen">
|
<div class="flex flex-col justify-center align-center w-screen h-screen">
|
||||||
<form on:submit|preventDefault class="flex-col flex justify-center align-center mx-auto">
|
<form on:submit|preventDefault class="flex-col flex justify-center align-center mx-auto">
|
||||||
<h1 class="text-lg text-center">{$t('words.game_pin')}</h1>
|
<h1 class="text-lg text-center">{$t('words.game_pin')}</h1>
|
||||||
<input
|
<input
|
||||||
class="border border-gray-400 self-center text-center text-black ring-0 outline-none p-2 rounded-lg focus:shadow-2xl transition-all"
|
class="border border-gray-400 self-center text-center text-black ring-0 outline-none p-2 rounded-lg focus:shadow-2xl transition-all"
|
||||||
bind:value={game_pin}
|
bind:value={game_pin}
|
||||||
maxlength="8"
|
maxlength="6"
|
||||||
|
inputmode="numeric"
|
||||||
/>
|
/>
|
||||||
<!-- use:tippy={{content: "Please enter the game pin", sticky: true, placement: 'top'}}-->
|
<!-- use:tippy={{content: "Please enter the game pin", sticky: true, placement: 'top'}}-->
|
||||||
|
|
||||||
@@ -176,7 +179,7 @@
|
|||||||
<button
|
<button
|
||||||
class="bg-[#B07156] hover:bg-amber-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50 disabled:cursor-not-allowed mt-2"
|
class="bg-[#B07156] hover:bg-amber-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50 disabled:cursor-not-allowed mt-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={game_pin.length <= 5}
|
disabled={game_pin.length < 6}
|
||||||
>
|
>
|
||||||
{$t('words.submit')}
|
{$t('words.submit')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user