From 03528a25215330d3b00cabdb1bbe7ce701e1bfeb Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 6 Jul 2024 20:16:48 -0500 Subject: implement level loading animation --- main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'main.js') diff --git a/main.js b/main.js index a052d74..0415b29 100644 --- a/main.js +++ b/main.js @@ -20,12 +20,12 @@ window.onload = () => { root.appendChild(title2); const paragraph = document.createElement('p'); - paragraph.innerText = 'Greetings, navigator! Thank you for helping us to program the hyperspace engines of our Automated Monopole Harvester (AMH) platforms. By doing so, you help ensure stable antimatter production throughout the Nine Worlds.'; + paragraph.innerText = 'greetings, navigator! thank you for helping us to program the hyperspace engines of our automated monopole harvester (AMH) platforms. by doing so, you help ensure stable antimatter production throughout the eight worlds.'; root.appendChild(paragraph); const start = document.createElement('input'); start.type = 'button'; - start.value = 'Connect to AMH'; + start.value = 'connect to AMH'; start.onclick = () => { root.classList.remove('center'); root.innerText = ''; @@ -40,11 +40,11 @@ window.onload = () => { } musicGain.gain.value = 0.5; const musicList = [ + 'music-aeroplane', 'music-minute', 'music-starboard', - 'music-cribwhistling', 'music-swish', - 'music-aeroplane', + 'music-cribwhistling', ].reduce(addMusic, []); musicList.forEach( ({ element }, i) => element.addEventListener( @@ -57,8 +57,10 @@ window.onload = () => { const sfx = {}; sfx.buttonEnterAudio = document.getElementById('sfx-buttonenter'); sfx.buttonClickAudio = document.getElementById('sfx-buttonclick'); + sfx.listAppearAudio = document.getElementById('sfx-listappear'); audio.createMediaElementSource(sfx.buttonEnterAudio).connect(audio.destination); audio.createMediaElementSource(sfx.buttonClickAudio).connect(audio.destination); + audio.createMediaElementSource(sfx.listAppearAudio).connect(audio.destination); sfx.resourceAudio = document.getElementById('sfx-resource'); sfx.resourceSource = audio.createMediaElementSource(sfx.resourceAudio); -- cgit v1.2.1