File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const normal = document.getElementById('normal');
66const hard = document . getElementById ( 'hard' ) ;
77// 重置
88const reset = document . getElementById ( 'reset' ) ;
9- //偷看
9+ // 偷看
1010const look = document . getElementById ( 'look' ) ;
1111
1212// 初始設定
@@ -45,7 +45,7 @@ function checkForMatch() {
4545}
4646
4747function 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
115115function 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
129130function resetGame ( ) {
You can’t perform that action at this time.
0 commit comments