diff --git a/index.html b/index.html index 82049be..cc780b5 100644 --- a/index.html +++ b/index.html @@ -42,11 +42,6 @@ body { background: linear-gradient(var(--pico-background-color) 60%, transparent); text-shadow: 0 0 10px var(--pico-background-color); } - - body > main { - margin: -5rem; - padding: 5rem; - } body > footer { position: sticky; @@ -171,8 +166,10 @@ question.onkeydown = function(e) { }; question.onfocus = function() { - window.onresize(); - formulaire.scrollIntoView({ block: 'start', behavior: 'smooth' }); + window.setTimeout(() => { + window.onresize(); + footer.scrollIntoView({ block: 'end', behavior: 'smooth' }); + }, 200) }; question.onblur = function() { @@ -235,7 +232,7 @@ formulaire.addEventListener('submit', async (e) => { let t = 0; Array.from(reponse).forEach((lettre, i) => { t += 100 * Math.random() - if (lettre == " ") t += 100 + if (lettre == " ") t += 50 setTimeout(() => { if (lettre == "\n") { paragraphe.innerHTML += "
"; @@ -333,6 +330,8 @@ if (SpeechRecognition) { reconnaissance.interimResults = false; reconnaissance.maxAlternatives = 1; bouton_reconnaissance_vocale.classList.add("contrast") + const placeholder = question.placeholder + question.placeholder = "À votre écoute" reconnaissance.onresult = function(event) { const transcript = event.results[0][0].transcript; @@ -344,6 +343,7 @@ if (SpeechRecognition) { reconnaissance.onnomatch = function () { reconnaissance.stop(); bouton_reconnaissance_vocale.classList.remove("contrast") + question.placeholder = placeholder }; reconnaissance.start();