Skip to content

Commit

Permalink
fix issue #13
Browse files Browse the repository at this point in the history
  • Loading branch information
KageRyo committed Apr 14, 2023
1 parent e834172 commit c307df5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ function lookCard() {
// 鎖定遊戲版面
lockBoard = true;
hasFlippedCard = false;
flip.forEach(card => card.removeEventListener('click', flipCard));
// 重置第一次點擊
const lookCardback = document.querySelectorAll(".memory-card");
// 偷看
Expand All @@ -206,7 +207,11 @@ function lookCard() {
const lookCardback = document.querySelectorAll(".memory-card");
lookCardback.forEach(card => card.classList.remove('flip'));
}, 1200);
// 偷看結束
setTimeout(() => { lockBoard = false; }, 800);
setTimeout(() => {
flip.forEach(card => card.addEventListener('click', flipCard));
}, 1200);
}

function resetGame() {
Expand Down

0 comments on commit c307df5

Please sign in to comment.