| 49 | }) |
| 50 | |
| 51 | function showTime(){ |
| 52 | |
| 53 | quoteDisplayElement.innerText = "Your time: " + myTime + "s.\n" + |
| 54 | "Total keys press = " + totalKeysPress + "\n" + |
| 55 | "Correct keys press = " + correctKeysPress + "\n" + |
| 56 | "Incorrect keys press = " + (totalKeysPress - correctKeysPress) + "\n" + |
| 57 | "success % = " + ((correctKeysPress * 100 ) / totalKeysPress).toFixed(2) + " %" |
| 58 | quoteAuthorElement.innerText = "" |
| 59 | quoteInputElement.style.display = "none" |
| 60 | timerElement.style.visibility = "hidden" |
| 61 | totalKeysPress = 0 |
| 62 | correctKeysPress = 0 |
| 63 | incorrectKeysPress = 0 |
| 64 | } |
| 65 | |
| 66 | function getRandomQuote() { |
| 67 | return fetch(RANDOM_QUOTE_API_URL) |