fix rot volume rep

This commit is contained in:
uwaa 2025-01-11 13:57:08 +00:00
parent daed10ba44
commit 1b37598723

6
rot.js
View file

@ -77,7 +77,7 @@
function volumeSet(number) { function volumeSet(number) {
audio.volume = number; //Set audio.volume = number; //Set
localStorage.audiovolume = Math.round(number * 100); //Save localStorage.audiovolume = number; //Save
updateVolumeLabel(); updateVolumeLabel();
} }
function volumeAdd(number) { function volumeAdd(number) {
@ -249,8 +249,8 @@
audio.loop = true; audio.loop = true;
audio.id = "user-music"; audio.id = "user-music";
audio.style = "display:none;"; audio.style = "display:none;";
if (localStorage.audiovolume) if (localStorage.audiovolume && localStorage.audiovolume >= 0 && localStorage.audiovolume <= 1)
audio.volume = localStorage.audiovolume / 100; //Load volume audio.volume = localStorage.audiovolume; //Load volume
else else
audio.volume = 0.2; //Default volume audio.volume = 0.2; //Default volume