Skip to content

Commit

Permalink
Stop timer if user finished matching all pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
quynhnle135 committed Feb 23, 2024
1 parent c85bafe commit 1f1e89d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function matchCards(img1, img2) {
matched++;
// If all 8 pairs are matched, pop up win modal
if (matched === 8) {
clearInterval(intervalID);
setTimeout(() => {
modal_container.classList.add("show");
}, 500);
Expand Down

0 comments on commit 1f1e89d

Please sign in to comment.