Visitar URL original
score update while keydown · wesbos/JavaScript30@ed3fc16 · GitHub
Skip to content

Commit ed3fc16

Browse files
committed
score update while keydown
1 parent 8c8d19b commit ed3fc16

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎01 - JavaScript Drum Kit/index-game.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@
9494

9595
console.log('win');
9696
console.log(score);
97-
document.getElementById('score').innerHTML=score;
9897
}else {
9998
console.log('lose');
10099
score=0;
101100
}
101+
document.getElementById('score').innerHTML=score;
102102
nextQuestion = setTimeout(function(){ playQuestion(); }, 2000);
103103

104104
}

‎01 - JavaScript Drum Kit/style.css‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ kbd {
4343
}
4444

4545
#score {
46+
position: absolute;
4647
display: block;
4748
font-size: 100px;
4849
top: 0;
49-
color: #000000;
50+
color: white;
51+
top: 20%;
52+
left: 50%;
53+
transform: translate(-50%, -50%);
5054
}
5155

5256
.sound {

0 commit comments

Comments
 (0)