-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d801060
commit 42f4f72
Showing
6 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Whack A Mole!</title> | ||
<link href='https://fonts.googleapis.com/css?family=Amatic+SC:400,700' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
|
||
<h1>Whack-a-mole! <span class="score">0</span></h1> | ||
<button onClick="startGame()">Start!</button> | ||
|
||
<div class="game"> | ||
<div class="hole hole1"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole2"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole3"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole4"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole5"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole6"> | ||
<div class="mole"></div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
const holes = document.querySelectorAll('.hole'); | ||
const scoreBoard = document.querySelector('.score'); | ||
const moles = document.querySelectorAll('.mole'); | ||
|
||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Whack A Mole!</title> | ||
<link href='https://fonts.googleapis.com/css?family=Amatic+SC:400,700' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
|
||
<h1>Whack-a-mole! <span class="score">0</span></h1> | ||
<button onClick="startGame()">Start!</button> | ||
|
||
<div class="game"> | ||
<div class="hole hole1"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole2"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole3"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole4"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole5"> | ||
<div class="mole"></div> | ||
</div> | ||
<div class="hole hole6"> | ||
<div class="mole"></div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
const holes = document.querySelectorAll('.hole'); | ||
const scoreBoard = document.querySelector('.score'); | ||
const moles = document.querySelectorAll('.mole'); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
html { | ||
box-sizing: border-box; | ||
font-size: 10px; | ||
background: #ffc600; | ||
} | ||
|
||
*, *:before, *:after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
padding: 0; | ||
margin:0; | ||
font-family: 'Amatic SC', cursive; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
font-size: 10rem; | ||
line-height:1; | ||
margin-bottom: 0; | ||
} | ||
|
||
.score { | ||
background:rgba(255,255,255,0.2); | ||
padding:0 3rem; | ||
line-height:1; | ||
border-radius:1rem; | ||
} | ||
|
||
.game { | ||
width:600px; | ||
height:400px; | ||
display:flex; | ||
flex-wrap:wrap; | ||
margin:0 auto; | ||
} | ||
|
||
.hole { | ||
flex: 1 0 33.33%; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
.hole:after { | ||
display: block; | ||
background: url(dirt.svg) bottom center no-repeat; | ||
background-size:contain; | ||
content:''; | ||
width: 100%; | ||
height:70px; | ||
position: absolute; | ||
z-index: 2; | ||
bottom:-30px; | ||
} | ||
|
||
.mole { | ||
background:url('mole.svg') bottom center no-repeat; | ||
background-size:60%; | ||
position: absolute; | ||
top: 100%; | ||
width: 100%; | ||
height: 100%; | ||
transition:all 0.4s; | ||
} | ||
|
||
.hole.up .mole { | ||
top:0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters