Skip to content

Commit 93bfad5

Browse files
committed
modifications
1 parent 9f29e86 commit 93bfad5

3 files changed

Lines changed: 61 additions & 7 deletions

File tree

index.html

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
<html>
22
<head>
33
<title>Reaction Time Game</title>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
7+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
8+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
9+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
410

511
<link rel="stylesheet" type="text/css" href="style.css">
612
</head>
713

814
<body>
915

10-
<h1>Test Your Reactions!</h1>
11-
<h2>Click On The Boxes And Circles As Quickly As You Can! </h2>
12-
<h3>Your best time and the current time is displayed before</h3>
1316

14-
<p class="bold">Your Time: <span id="timeTaken"></span></p>
1517

16-
<p class="bold">Your Best Time: <span id="best"></span></p>
18+
<p class="bold">
19+
Your Time: <span id="timeTaken" style="color: green;"></span>
20+
Your Best Time: <span id="best" style="color: blue;"></span>
21+
22+
</p>
23+
<div><button id="rules" style="text-align: center; width: 150px; margin-left: 800px; border-radius: 10px;">Tip</button></div>
1724

1825
<div id="shape"></div>
19-
20-
<script type="text/javascript" src="script.js"></script>
26+
<canvas id="myCanvas" width="1500" height="300">
27+
28+
<script type="text/javascript" src="script.js"></script>
29+
</canvas>
2130

2231
</body>
2332

intro.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Reaction-timer Intro</title>
7+
<style>
8+
body {
9+
text-align: center;
10+
background-color: lightgray;
11+
font-size: 25px;
12+
}
13+
a {
14+
text-decoration: none;
15+
border: 2px solid darkgray;
16+
padding: 20px;
17+
font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
18+
border-radius: 10px;
19+
}
20+
a:hover {
21+
background-color: blue;
22+
color: white;
23+
24+
}
25+
div {
26+
margin-top: 300px;
27+
min-height: 791px;
28+
min-width: 691px;
29+
}
30+
31+
</style>
32+
</head>
33+
<body>
34+
<div>
35+
<h1>Test Your Reactions!</h1>
36+
<h2>Click On The Boxes And Circles As Quickly As You Can! </h2>
37+
<h3>Your best time and the current time is displayed before</h3>
38+
<a href="/index.html">Play Game!</a>
39+
</div>
40+
41+
</body>
42+
</html>

script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
var bestTime = 10;
22
var start = new Date().getTime();
3+
document.getElementById("rules").onclick = function () {
4+
alert("Try to click the shapes as soon as possible to increase your score");
5+
}
36

47
function getRandomColor() {
58

0 commit comments

Comments
 (0)