mirror of
https://git.rape.pet/ulith/amputoma-fe.git
synced 2025-01-31 08:33:22 +01:00
dont require music-controls
This commit is contained in:
parent
6c5def32ce
commit
911e6f160c
1 changed files with 5 additions and 9 deletions
|
@ -255,16 +255,10 @@
|
|||
audio.volume = 0.2; //Default volume
|
||||
|
||||
//Initialize audio controls and event listeners
|
||||
waitUntil("#music-controls").then((controls) => {
|
||||
updateVolumeLabel();
|
||||
controls.querySelector("#music-up").onclick = () => volumeAdd(0.05);
|
||||
controls.querySelector("#music-down").onclick = () => volumeAdd(-0.05);
|
||||
});
|
||||
waitUntil("#music-up").then((btn) => btn.addEventListener('click', () => volumeAdd(0.05)));
|
||||
waitUntil("#music-down").then((btn) => btn.addEventListener('click', () => volumeAdd(-0.05)));
|
||||
|
||||
waitUntil("#music-slider").then((slider) => {
|
||||
updateVolumeLabel();
|
||||
slider.oninput = () => volumeSet(slider.value / 100);
|
||||
});
|
||||
waitUntil("#music-slider").then((slider) => slider.addEventListener('input', () => volumeSet(slider.value / 100)));
|
||||
|
||||
waitUntil("#music-mute").then((box) => {
|
||||
audio.muted = box.checked = localStorage.audiomuted === "true";
|
||||
|
@ -274,6 +268,8 @@
|
|||
})
|
||||
});
|
||||
|
||||
waitUntil("#user-audio-percentage").then(updateVolumeLabel);
|
||||
|
||||
//Monkey patches and event listeners
|
||||
const oldPushState = history.pushState;
|
||||
history.pushState = function pushState() {
|
||||
|
|
Loading…
Reference in a new issue