-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
31 lines (31 loc) · 1.05 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
/*var frozen = document.querySelector('#frozen');
var chimera = document.querySelector('#chimera');
var follow = document.querySelector('#follow');
var sun = document.querySelector('#sun');
var iodine = document.querySelector('#iodine');
var chemist = document.querySelector('#chemist');
var close = document.querySelector('#close');
var paranoia = document.querySelector('#paranoia');
var uncle = document.querySelector('#uncle');
var chemist2023 = document.querySelector('#chemist2023');
var sun2023 = document.querySelector('#sun2023');
var iodine2023 = document.querySelector('#iodine2023');*/
var tracks = document.querySelectorAll('#demo2023 audio');
for (let t of tracks) {
t.onplay = function() {
for (let o of tracks) {
if (o != t)
o.pause();
}
}
}
console.assert(tracks.length == 3);
for (let i = 0; i < tracks.length; ++i) {
if (i < tracks.length - 1) {
const nexttrack = tracks[i + 1];
tracks[i].onended = function() { nexttrack.play(); }
} else {
const nexttrack = tracks[i - 2];
tracks[i].onended = function() { nexttrack.play(); }
}
}