mirror of
https://github.com/microsoft/Web-Dev-For-Beginners.git
synced 2025-09-03 11:43:03 +02:00
fix: added export default messages in index.js
This commit is contained in:
@@ -31,7 +31,7 @@ document.getElementById('start').addEventListener('click', function () {
|
|||||||
|
|
||||||
// UI updates
|
// UI updates
|
||||||
// Create an array of span elements so we can set a class
|
// Create an array of span elements so we can set a class
|
||||||
const spanWords = words.map(function(word) { return `<span>${word} </span>`});
|
const spanWords = words.map(function (word) { return `<span>${word} </span>` });
|
||||||
// Convert into string and set as innerHTML on quote display
|
// Convert into string and set as innerHTML on quote display
|
||||||
quoteElement.innerHTML = spanWords.join('');
|
quoteElement.innerHTML = spanWords.join('');
|
||||||
// Highlight the first word
|
// Highlight the first word
|
||||||
@@ -83,3 +83,12 @@ typedValueElement.addEventListener('input', (e) => {
|
|||||||
typedValueElement.className = 'error';
|
typedValueElement.className = 'error';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add this at the end of the file
|
||||||
|
const messages = {
|
||||||
|
success: "CONGRATULATIONS! You finished in {seconds} seconds.",
|
||||||
|
error: "Oops! There's a mistake.",
|
||||||
|
start: "Start typing to begin the game."
|
||||||
|
};
|
||||||
|
|
||||||
|
export default messages;
|
||||||
|
Reference in New Issue
Block a user