-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
57 lines (32 loc) · 1.11 KB
/
script.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'audio.mp3');
console.log(audioElement);
audioElement.load();
window.addEventListener("mousemove", function() {
audioElement.play();
}, true);
const panels = document.querySelectorAll(".panel");
function toggleOpen() {
if (this.children[1].style.display === "block") {
this.children[1].style.display = "";
}else{
this.children[1].style.display = "block";
}
this.classList.toggle("open")
}
function toggleActive(e) {
if (e.propertyName.includes("flex")) {
this.classList.toggle("open-active");
}
}
panels.forEach((panel) => panel.addEventListener("click", toggleOpen));
panels.forEach((panel) =>
panel.addEventListener("transitionend", toggleActive)
);
const animated = document.querySelector('.frame-5');
const animatedDiv = document.querySelector('.container')
animated.addEventListener('animationend', () => {
setTimeout(() => {
animatedDiv.style.display = "none";
}, 3000);
});