-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (65 loc) · 1.38 KB
/
index.html
File metadata and controls
75 lines (65 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Game</title>
<style>
h1 {
text-align: center;
}
#container {
/*height: 600px;*/
background-color: beige;
padding: 0;
}
.box {
float: left;
background-color: black;
height: 100px;
width: 100px;
margin: 5px;
}
.bottom {
width:100px;
clear: both;
}
.red {
background-color: red;
}
.green {
background-color: green;
}
</style>
</head>
<body>
<h1>The Treasure Hunt</h1>
<div id ='container'>
<div class='box one'></div>
<div class='box two'></div>
<div class='box three'></div>
<div class='box four'></div>
<div class='box five'></div>
<div class='box six'></div>
<div class='box seven'></div>
<div class='box eight'></div>
<div class='bottom'></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!--<script src='jquery.transit.min.js'></script>-->
<script>
var prize = Math.floor(Math.random()* 8);
var prizeArr = ['.one','.two','.three','.four','.five','.six', '.seven' , '.eight'];
classThatWins = prizeArr[prize];
console.log(prizeArr);
$(document).ready(function(){
$(classThatWins).addClass('winner');
$('.box.winner').click(function(){
$(this).addClass('green');
})
$('.box').click(function(){
$(this).addClass('red');
})
});
</script>
</body>
</html>