-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.js
31 lines (28 loc) · 996 Bytes
/
entry.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Board from './board.js';
import Puyo from './puyo.js';
import Game from './game.js';
document.addEventListener("DOMContentLoaded", ()=>{
let welcome = document.getElementById("welcome")
let startButton = document.getElementById("startGame");
let restartButton = document.getElementById("restartGame")
let gameOver = document.getElementById("GameOver");
let volControl = document.getElementById("vcDiv");
window.muted = false;
startButton.addEventListener("click", () => {
welcome.style.display = "none";
return new Game();
})
restartButton.addEventListener("click", ()=>{
gameOver.style.display ="none";
return new Game();
})
volControl.addEventListener("click", ()=>{
volControl.innerHTML = ''
if(window.muted){
volControl.innerHTML = `<i class="fa fa-volume-up" aria-hidden="true"></i>`
} else {
volControl.innerHTML = `<i class="fa fa-volume-off" aria-hidden="true"></i>`
}
window.muted = !window.muted
})
});