Fix sliders not turning off in share mode

This commit is contained in:
MeowcaTheoRange 2024-01-03 02:31:10 -06:00
parent a0883729bc
commit 4ed1b54bd5
2 changed files with 4 additions and 2 deletions

View file

@ -55,11 +55,11 @@
text-align: end; text-align: end;
} }
input[type="range"]:not(.ro):disabled:-webkit-slider-thumb { input[type="range"].off:-webkit-slider-thumb {
opacity: 0; opacity: 0;
} }
input[type="range"]:not(.ro):disabled::-moz-range-thumb { input[type="range"].off::-moz-range-thumb {
opacity: 0; opacity: 0;
} }

View file

@ -189,6 +189,7 @@ function triggerSliders(generate) {
} }
sliderElement.disabled = !func(overrideElement); sliderElement.disabled = !func(overrideElement);
if (!func(overrideElement)) sliderElement.classList.add("off");
updateDescription( updateDescription(
description[0], description[0],
@ -278,6 +279,7 @@ function parseURL() {
document.addEventListener("DOMContentLoaded", () => triggerSliders(true)); document.addEventListener("DOMContentLoaded", () => triggerSliders(true));
return; return;
} }
triggerSliders(false);
nameElement.value = urlParams.get("n") || ""; nameElement.value = urlParams.get("n") || "";
decode(urlParams.get("s")); decode(urlParams.get("s"));
sliders.forEach(([slider, override]) => { sliders.forEach(([slider, override]) => {