Skip to content
Extraits de code Groupes Projets
Valider efc12d57 rédigé par Brieuc Dubois's avatar Brieuc Dubois
Parcourir les fichiers

frontend: typing test with errors

parent 470c230e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -53,8 +53,17 @@ ...@@ -53,8 +53,17 @@
</div> </div>
</div> </div>
<div class="relative border-2 rounded text-xl select-none"> <div class="relative border-2 rounded text-xl select-none">
<div class="text-gray-400 font-mono p-4"> <div class="font-mono p-4">
{text} <span class="text-inherit p-0 m-0 whitespace-pre-wrap"
><!--
-->{#each text.slice(0, input.length) as char, i}<!--
--><span
class="text-gray-800 p-0 m-0"
class:text-red-500={char !== input[i]}>{input[i]}</span
><!--
-->{/each}<!--
--></span
><span class="text-gray-400 p-0 m-0">{text.slice(input.length)}</span>
</div> </div>
<textarea <textarea
bind:value={input} bind:value={input}
...@@ -64,13 +73,14 @@ ...@@ -64,13 +73,14 @@
if (!inProgress && duration > 0) { if (!inProgress && duration > 0) {
start(); start();
} }
if (inProgress && text.toLowerCase().startsWith(input.toLowerCase())) { if (inProgress) {
// && text.toLowerCase().startsWith(input.toLowerCase())) {
lastInput = input; lastInput = input;
} else { } else {
input = lastInput; input = lastInput;
} }
}} }}
class="absolute top-0 resize-none font-mono p-4 w-full h-full bg-transparent select-none" class="absolute top-0 resize-none font-mono p-4 w-full h-full bg-transparent select-none text-transparent"
/> />
</div> </div>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter