-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava.js
More file actions
36 lines (29 loc) · 914 Bytes
/
java.js
File metadata and controls
36 lines (29 loc) · 914 Bytes
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
32
33
34
35
36
let back = document.querySelector("#newback");
let startAnim = document.querySelector(".start");
let hero = document.querySelector("#man")
let aud = document.querySelector("#morningSound");
aud.play();
let audwater = document.querySelector("#waterSound")
audwater.play();
audwater.loop = true;
startAnim.addEventListener("click", startAnimations);
function startAnimations() {
console.log("next scene please");
aud.addEventListener('ended', soundEnded);
}
function soundEnded() {
console.log("Rooster sound ended..")
}
function backgroundNew() {
let bg = document.getElementById("myDIV");
if (bg.style.display === "none") {
} else {
bg.style.display = "block";
hero.classList.add("walk");
console.log("The man will walk in!")
}
}
hero.addEventListener('animationend', heroStop)
function heroStop() {
console.log("And itsssss over, short but sweet")
}