Skip to content

Commit f48a7e9

Browse files
committed
Progress on wesbos#30
1 parent 3e406ff commit f48a7e9

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

30 - Whack A Mole/index-START.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<body>
1010

1111
<h1>Whack-a-mole! <span class="score">0</span></h1>
12-
<button onClick="startGame()">Start!</button>
12+
<div class="button">
13+
<button onClick="startGame()">Start!</button>
14+
</div>
1315

1416
<div class="game">
1517
<div class="hole hole1">
@@ -37,6 +39,15 @@ <h1>Whack-a-mole! <span class="score">0</span></h1>
3739
const scoreBoard = document.querySelector('.score');
3840
const moles = document.querySelectorAll('.mole');
3941

42+
function randTime(min, max) {
43+
return Math.random() * (max - min) + min;
44+
}
45+
46+
function randomHole(holes) {
47+
// holes is a NodeList
48+
console.log(holes.length);
49+
}
50+
4051
</script>
4152
</body>
4253
</html>

30 - Whack A Mole/style.css

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@ html {
1111
body {
1212
padding: 0;
1313
margin:0;
14+
font-family: "Helvetica Neue", Helvetica, sans-serif;
15+
font-size: 16px;
16+
}
17+
18+
body button,
19+
body input {
20+
font-family: inherit;
21+
}
22+
23+
h1, .score {
1424
font-family: 'Amatic SC', cursive;
1525
}
1626

1727
h1 {
1828
text-align: center;
1929
font-size: 10rem;
2030
line-height:1;
21-
margin-bottom: 0;
31+
margin: 0.5em 0;
2232
}
2333

2434
.score {
@@ -67,3 +77,27 @@ h1 {
6777
.hole.up .mole {
6878
top:0;
6979
}
80+
81+
div.button {
82+
text-align: center;
83+
}
84+
button {
85+
display: inline-block;
86+
-webkit-appearance: none;
87+
box-shadow: none;
88+
border: 0;
89+
padding: 0.5em 1em;
90+
border-radius: 2px;
91+
font-size: 1em;
92+
cursor: pointer;
93+
outline: none;
94+
}
95+
button:hover {
96+
box-shadow: inset 0 0 0 20rem rgba(140, 140, 140, .0625);
97+
}
98+
button:active {
99+
box-shadow: inset 0 0 0 20rem rgba(140, 140, 140, .125),
100+
inset 0 3px 4px 0 rgba(140, 140, 140, .25),
101+
0 0 1px rgba(140, 140, 140, .125);
102+
103+
}

0 commit comments

Comments
 (0)