Skip to content

Commit

Permalink
Iniciando o dia 30
Browse files Browse the repository at this point in the history
  • Loading branch information
herminiotorres committed Jul 28, 2018
1 parent d801060 commit 42f4f72
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 0 deletions.
40 changes: 40 additions & 0 deletions 30-WhackAMole/dirt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions 30-WhackAMole/finish.html
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>
56 changes: 56 additions & 0 deletions 30-WhackAMole/mole.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions 30-WhackAMole/start.html
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>
69 changes: 69 additions & 0 deletions 30-WhackAMole/style.css
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;
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ $ npm start
* [27-ClickandDrag](https://herminiotorres.github.io/JavaScript30/27-ClickandDrag/finish.html)
* [28-VideoSpeedController](https://herminiotorres.github.io/JavaScript30/28-VideoSpeedController/finish.html)
* [29-CountdownTimer](https://herminiotorres.github.io/JavaScript30/29-CountdownTimer/finish.html)
* [30-WhackAMole](https://herminiotorres.github.io/JavaScript30/30-WhackAMole/finish.html)

0 comments on commit 42f4f72

Please sign in to comment.