mirror of
https://git.rape.pet/ulith/amputoma-fe.git
synced 2025-01-31 08:33:22 +01:00
remove "image" from rot.js
This commit is contained in:
parent
70ca1b2418
commit
bcd2394cc5
1 changed files with 10 additions and 31 deletions
|
@ -68,17 +68,6 @@
|
|||
audio.play().catch(() => getPromiseFromEvent(window, 'click').then(audio.play));
|
||||
}
|
||||
|
||||
function setImage(url) {
|
||||
if (url) {
|
||||
console.log("Setting background: " + url);
|
||||
let apploaded = document.getElementById("app-loaded");
|
||||
if (apploaded)
|
||||
apploaded.style.setProperty("--body-background-image", "url(" + url + ")");
|
||||
else
|
||||
console.log("Couldn't set background, app not yet loaded");
|
||||
}
|
||||
}
|
||||
|
||||
function volumeSet(number) {
|
||||
audio.volume = number; //Set
|
||||
localStorage.audiovolume = number; //Save
|
||||
|
@ -155,18 +144,13 @@
|
|||
return false;
|
||||
|
||||
const musicContainer = ptp.querySelector(".audio-container");
|
||||
if (musicContainer)
|
||||
if (musicContainer) {
|
||||
setMusic(rand(musicContainer.children).src);
|
||||
else
|
||||
return true;
|
||||
} else {
|
||||
setMusic(null);
|
||||
|
||||
const imageContainer = ptp.querySelector(".image-container");
|
||||
if (imageContainer)
|
||||
setImage(rand(imageContainer.getElementsByTagName("img")).src);
|
||||
else
|
||||
setImage(null);
|
||||
|
||||
return musicContainer || imageContainer;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//Configure by fields
|
||||
|
@ -176,18 +160,13 @@
|
|||
return false;
|
||||
|
||||
const musicFields = fields.filter((x) => x.title.toLowerCase().replace(/\s+/g, '') == "music")
|
||||
if (musicFields.length > 0)
|
||||
if (musicFields.length > 0) {
|
||||
setMusic(rand(musicFields).nextElementSibling.title);
|
||||
else
|
||||
return true;
|
||||
} else {
|
||||
setMusic(null);
|
||||
|
||||
const imageFields = fields.filter((x) => x.title.toLowerCase().replace(/\s+/g, '') == "image")
|
||||
if (imageFields.length > 0)
|
||||
setImage(rand(imageFields).nextElementSibling.title);
|
||||
else
|
||||
setImage(null);
|
||||
|
||||
return musicFields.length > 0 || imageFields.length > 0;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue