Skip to content

Commit

Permalink
add sound to click
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonleonhard committed Oct 2, 2018
1 parent ab03948 commit 36c53d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// when wacked update score
let wack = (id, value) => {


play()
updateScore(id, value)
}

Expand Down Expand Up @@ -32,3 +31,9 @@ let show_rand_mole = () => {
}, 1000);
}
show_rand_mole() // call on page load


function play() {
var audio = document.getElementById("audio");
audio.play();
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<div id="8" class="cell" onClick="wack(this.id,this.value)"></div>
<div id="9" class="cell" onClick="wack(this.id,this.value)"></div>
</div>
<audio id="audio" src="wack.mp3" ></audio>
</body>
<script src="app.js"></script>
</html>
Binary file added wack.mp3
Binary file not shown.

0 comments on commit 36c53d8

Please sign in to comment.