{#each letters as _, i}
{
if (event.inputType === "insertText") {
event.preventDefault();
let key = event.data ?? "";
if (/^[a-zA-Z]$/.test(key)) {
letters[i] = key.toUpperCase();
if (cursor < 4) {
cursor++;
} else {
cursor = 0;
}
inputs[cursor].focus();
}
}
}}
onclick={() => {
if (!active) {
return;
}
if (cursor === i) {
colors[cursor] = (colors[cursor] + 1) % 3;
} else {
cursor = i;
}
}}
/>
{/each}
{#if info_gained === null}
↵
{:else}
{#await info_gained}
{:then i}
{i.info_gained.toFixed(2)} bits
{:catch e}
!
{/await}
{/if}