Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ let typeSpeed = 27;

function type() {
const currentPhrase = phrases[phraseIndex];

if (isDeleting) {
// Remove a character
textElement.textContent = currentPhrase.substring(0, characterIndex - 1);
characterIndex--;
typeSpeed = 50;
typeSpeed = 50;
} else {
// Add a character
textElement.textContent = currentPhrase.substring(0, characterIndex + 1);
Expand All @@ -254,7 +254,7 @@ function type() {

if (!isDeleting && characterIndex === currentPhrase.length) {
isDeleting = true;
typeSpeed = 2000;
typeSpeed = 2000;
} else if (isDeleting && characterIndex === 0) {
isDeleting = false;
phraseIndex = (phraseIndex + 1) % phrases.length;
Expand Down Expand Up @@ -504,7 +504,7 @@ const handleCorrectMove = () => {

const handleWrongMove = () => {
puzzleLocked = true;
setMessage("Not mate. Hit reset and try the knight move again.");
setMessage("Not mate. Hit reset and try again.");
chessSuccess?.classList.add("hidden");
renderBoard();
};
Expand Down
Loading