mirror of https://github.com/sundowndev/Detank.git
update js
parent
8498dfef64
commit
b6c7aca000
|
@ -254,6 +254,7 @@ function run (difficulty) {
|
|||
gameover.style.display = 'block';
|
||||
playing = false;
|
||||
clearInterval(ntm);
|
||||
nanoPlayer.pause();
|
||||
}
|
||||
}, difficulty);
|
||||
|
||||
|
@ -262,9 +263,10 @@ function run (difficulty) {
|
|||
}
|
||||
|
||||
var replay = document.querySelector('.replay');
|
||||
var startmenu = document.querySelector('.startmenu');
|
||||
var easy = document.querySelector('.play.easy');
|
||||
var hard = document.querySelector('.play.hard');
|
||||
var startmenu = document.querySelector('.startmenu');
|
||||
var mute = document.querySelector('#mute');
|
||||
|
||||
replay.addEventListener('click', function(){
|
||||
run('easy');
|
||||
|
@ -273,9 +275,23 @@ replay.addEventListener('click', function(){
|
|||
easy.addEventListener('click', function(){
|
||||
run('easy');
|
||||
startmenu.style.display = 'none';
|
||||
nanoPlayer.play();
|
||||
});
|
||||
|
||||
hard.addEventListener('click', function(){
|
||||
run('hard');
|
||||
startmenu.style.display = 'none';
|
||||
nanoPlayer.play();
|
||||
});
|
||||
|
||||
mute.addEventListener('click', function(e){
|
||||
var mute = document.querySelector('#mute');
|
||||
|
||||
if(mute.classList.contains('mute-off')){
|
||||
mute.classList.remove('mute-off');
|
||||
nanoPlayer.play();
|
||||
}else{
|
||||
mute.classList.add('mute-off');
|
||||
nanoPlayer.pause();
|
||||
}
|
||||
});
|
|
@ -30,7 +30,7 @@
|
|||
<a href="#" class="play hard">Pas facile</a>
|
||||
<img src="assets/img/tank.png" alt="tank">
|
||||
</div>
|
||||
<div id="mute" class="mute mute-off"></div>
|
||||
<div id="mute" class="mute"></div>
|
||||
<div class="line line-1">
|
||||
<div class="col col-1"></div>
|
||||
<div class="col col-2"></div>
|
||||
|
@ -261,7 +261,7 @@
|
|||
<script>
|
||||
var nanoPlayer = new nanoPlayer('.nano-player', {
|
||||
// Parameters
|
||||
autoplay: true,
|
||||
autoplay: false,
|
||||
loop: true,
|
||||
defaultVolume: 100,
|
||||
songList: [
|
||||
|
|
Loading…
Reference in New Issue