diff --git a/README.md b/README.md index 22dea27..e38e32d 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,6 @@ Javascript app to help people get used to navigation in vim by gamifying it. Pla * `w` to move to the next word * `e` to move to the end of the current word (next word if the cursor is hovering whitespace/end of the current word) * `b` to move to the beginning of the current word (previous word if the cursor is hovering whitespace/beginning of current word) + +## Music +* http://www.bensound.com/royalty-free-music/track/sci-fi diff --git a/css/main.css b/css/main.css index 1e5f942..763ade2 100644 --- a/css/main.css +++ b/css/main.css @@ -27,4 +27,4 @@ body { height: 27px; text-align: right; -} +} \ No newline at end of file diff --git a/css/utility.css b/css/utility.css index d550c49..40905bc 100644 --- a/css/utility.css +++ b/css/utility.css @@ -29,3 +29,16 @@ .score:after { content: ','; } + +#mute{ + position:absolute; + margin-top:-240px; + margin-left:556px; + width:50px; + height:50px; + + background-image: url(../images/mutedButton.png); +} +#mute:hover{ + background-image: url(../images/muteButton.png); +} \ No newline at end of file diff --git a/images/muteButton.png b/images/muteButton.png new file mode 100644 index 0000000..b4ffd07 Binary files /dev/null and b/images/muteButton.png differ diff --git a/images/mutedButton.png b/images/mutedButton.png new file mode 100644 index 0000000..72003a4 Binary files /dev/null and b/images/mutedButton.png differ diff --git a/index.html b/index.html index e382ff9..ebbd39a 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,11 @@ +
+ +
@@ -32,11 +37,13 @@
+ + diff --git a/js/main.js b/js/main.js index 947e1c4..4725972 100644 --- a/js/main.js +++ b/js/main.js @@ -21,7 +21,6 @@ function Main(){ this.isStarted = false; } - Main.prototype._showGameOver = function(){ var _this = this, initializer = new Initializer(); diff --git a/js/music.js b/js/music.js new file mode 100644 index 0000000..fde8bda --- /dev/null +++ b/js/music.js @@ -0,0 +1,14 @@ +$(function(){ + + var audio = document.getElementById('sound'); + + function musicSwitch(){ + if(audio.paused){ + audio.play(); + } + else{ + audio.pause() + } + } + document.getElementById('mute').addEventListener('click', musicSwitch); +}); \ No newline at end of file diff --git a/music/bensound-scifi.mp3 b/music/bensound-scifi.mp3 new file mode 100644 index 0000000..cc77342 Binary files /dev/null and b/music/bensound-scifi.mp3 differ