-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharena.js
30 lines (27 loc) · 855 Bytes
/
arena.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
let options = document.querySelectorAll(".options")
let waterDropSound = new Audio("./assets/water-drop.mp3")
let bgm = new Audio("./assets/choose-bgm.mp3")
let colorTest = document.querySelector(".color-test")
let pop = document.querySelector(".pop")
let car = document.querySelector(".car")
let username = document.querySelector("#username")
username.textContent = localStorage.getItem("name")
bgm.play()
bgm.loop = true
// function for sound effect
options.forEach((e)=>{
e.addEventListener("mouseenter",()=>{
// console.log("in")
waterDropSound.play()
})
})
// click on divs to enter different game modes
colorTest.onclick = ()=>{
window.open("full-screen-reaction.html","_self")
}
pop.onclick = ()=>{
window.open("random-elements.html", "_self")
}
car.onclick = ()=>{
window.open("car-reaction.html", "_self")
}