Skip to content
Open
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
7 changes: 6 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ function checkMatchCard(item) {

// function to rmove class open and show from cards [first and second card]
function clearSelectedCards() {
let allCards = document.querySelectorAll('.card:not(.match)');
allCards.forEach(card => card.removeAttribute('onclick'));

setTimeout(() => {
if (firstCard) {
firstCard.classList.remove('open');
Expand All @@ -158,6 +161,8 @@ function clearSelectedCards() {
secondCard.classList.remove('show');
secondCard = null;
}

allCards.forEach(card => card.setAttribute('onclick', 'startGame(this)'));
}, 1000);
}

Expand Down Expand Up @@ -258,4 +263,4 @@ playAgain();
* + if the cards do not match, remove the cards from the list and hide the card's symbol (put this functionality in another function that you call from this one)[Done]
* + increment the move counter and display it on the page (put this functionality in another function that you call from this one)[Done]
* + if all cards have matched, display a message with the final score (put this functionality in another function that you call from this one)[Done]
*/
*/