From 8c44100220b31c0bcf4991ef01deacda3ad3ab4a Mon Sep 17 00:00:00 2001 From: uwaa Date: Mon, 27 Jan 2025 13:15:13 +0000 Subject: [PATCH] rot.js volume step simplify --- static/rot/rot.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/static/rot/rot.js b/static/rot/rot.js index 98b47016..cceb7ba0 100644 --- a/static/rot/rot.js +++ b/static/rot/rot.js @@ -378,17 +378,9 @@ localStorage.audiomuted = audio.muted = musicmute.checked; playMusic(); }) - volumeStepDwn.addEventListener('click', () => { - var e = audio.volume - 0.05; - if (e < 0) e = 0; - volumeSet(e); - }) - volumeStepUp.addEventListener('click', () => { - var e = audio.volume + 0.05; - if (e > 1) e = 1; - volumeSet(e); - }) - + volumeStepDwn.addEventListener('click', () => volumeAdd(-0.05)) + volumeStepUp.addEventListener('click', () => volumeAdd(0.05)) + updateVolumeLabel(); }