Skip to content

Commit ebb9694

Browse files
committed
annotation: function lookCard()
1 parent 97e307c commit ebb9694

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

script.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const normal = document.getElementById('normal');
66
const hard = document.getElementById('hard');
77
// 重置
88
const reset = document.getElementById('reset');
9-
//偷看
9+
// 偷看
1010
const look = document.getElementById('look');
1111

1212
// 初始設定
@@ -45,7 +45,7 @@ function checkForMatch() {
4545
}
4646

4747
function disableCards() {
48-
// 匹配成功,移除點擊事件
48+
// 匹配成功後移除點擊事件
4949
firstCard.closest('.show').classList="hide";
5050
secondCard.closest('.show').classList="hide";
5151
resetBoard();
@@ -113,17 +113,18 @@ function difficultyChoose() {
113113
}
114114

115115
function lookCard() {
116-
// 偷看
117-
lockBoard=true; //鎖定遊戲版面
118-
hasFlippedCard=false; //重置第一次點擊
116+
// 鎖定遊戲版面
117+
lockBoard=true;
118+
hasFlippedCard=false;
119+
// 重置第一次點擊
119120
const lookCardback=document.querySelectorAll(".memory-card");
121+
// 偷看
120122
lookCardback.forEach(card => card.classList.add('flip'));
121123
setTimeout(() => {
122124
const lookCardback=document.querySelectorAll(".memory-card");
123125
lookCardback.forEach(card => card.classList.remove('flip'));
124126
},1000);
125127
setTimeout(() => {lockBoard=false;},800);
126-
127128
}
128129

129130
function resetGame() {

0 commit comments

Comments
 (0)