Skip to content

Commit cf528fb

Browse files
committed
added counter time
1 parent 8349a7b commit cf528fb

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

images/backwards counter.gif

136 KB
Loading

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h2 class="coordinator-logo-bottom">2000</h2>
2424

2525
<div id="container" style="display: none">
2626
<canvas id="coordinator" width="500" height="600"></canvas>
27-
<div id="instructions-together">
27+
<img id="timer-counter" src="images/backwards counter.gif" alt="counter" style="display:none;">
28+
<div id="instructions-together">
2829
<p id="instructions"><b class="title-instructions">Instructions:</b><br> <br>Change direction with arrow keys.</p>
2930
<img id="arrows" src="images/keyboard2.png" alt="keyboard">
3031
<p id="instructions-two"><b class="be-careful">Be careful:</b> If you step out of the road more than <b class="percent-instructions">10%</b> of the time you will not pass the test!</p>
Binary file not shown.

scripts/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
1313
let rightPerc = document.getElementById('right-final-number');
1414
let passedFailed = document.getElementById('passed-failed');
1515
let instructions = document.getElementById('instructions-together');
16+
let counter = document.getElementById('timer-counter');
1617
ctx = canvas.getContext('2d');
1718

1819
function alertWhite() {
@@ -32,6 +33,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
3233
function hideInstructions() {
3334
playBtn.style = "display: none";
3435
instructions.style = "display: none";
36+
counter.style = "display:block";
3537
}
3638

3739
function createGameOverScreen() {

styles/stylesheet.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@
167167
color: #2ecc71;
168168
}
169169

170+
#timer-counter {
171+
position: absolute;
172+
width: 200px;
173+
top: 230px;
174+
right: 200px;
175+
}
176+
170177
/* Game Over Screen */
171178

172179
#gameover {

0 commit comments

Comments
 (0)