Skip to content

Commit

Permalink
add pause script
Browse files Browse the repository at this point in the history
  • Loading branch information
sugoides committed Feb 13, 2024
1 parent 4d39c7a commit 3a91c1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion will-you-be-my-valentine/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ function generateMessage(noCount) {
function changeImage(image) {
catImg.src = `img/cat-${image}.jpg`;
if (catImg.src =`img/cat-yes.jpg`){
setTimeout(updateNoButtonText, 3000)
setTimeout(pauseScript, 3000)
window.location.href = 'flower/';
}
}

function updateNoButtonText() {
noButton.innerHTML = generateMessage(noCount);
}
function pauseScript() {
// Do nothing, script is effectively paused
}

0 comments on commit 3a91c1e

Please sign in to comment.