Skip to content

Commit

Permalink
1.1 multiple touch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DeadCreator committed Aug 8, 2024
1 parent 7328e9d commit 1c163fe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ const checkMatched = () => {
}
}
async function lol() {
this.classList.add('active')
const activeCards = document.querySelectorAll('.active')

await delay(500)
let activeCards = document.querySelectorAll('.active')
if (activeCards.length < 2) {
this.classList.add('active')
activeCards = document.querySelectorAll('.active')

await delay(500)
}
if (activeCards.length === 2) {

if (activeCards[0].classList[1] === activeCards[1].classList[1]) {
console.log("Great!")
activeCards[0].classList.add('matched')
Expand Down

0 comments on commit 1c163fe

Please sign in to comment.