diff options
| -rw-r--r-- | Settings.json | 2 | ||||
| -rw-r--r-- | static/index.html | 1 | ||||
| -rw-r--r-- | static/index.js | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/Settings.json b/Settings.json index fbf587c..a0353fa 100644 --- a/Settings.json +++ b/Settings.json @@ -1,5 +1,5 @@ { - "SongsLocation": "/home/physick/Git/culture_exam/Tracks", + "SongsLocation": "/home/physick/git/culture_exam/Tracks", "Distribution": { "RandomisationChance": 0.5, "MaxPointPercent": 0.75, diff --git a/static/index.html b/static/index.html index 20d5f41..10eb9b4 100644 --- a/static/index.html +++ b/static/index.html @@ -27,6 +27,7 @@ <button onclick="ToggleInfo()" class="controlBtn"> <h1 onclick="Pause" class="controlElem" id="ToggleBtn"> Hide info </h1> </button> + <input type="range" id="volumeRange" oninput="SetVolume()"/> </div> <audio id="mainAudio"> <source type="audio/mpeg" /> diff --git a/static/index.js b/static/index.js index 237386c..991eb6c 100644 --- a/static/index.js +++ b/static/index.js @@ -19,6 +19,7 @@ function SetRandomSong() { document.getElementById("Start").innerHTML = "Start: " + body.Start + "s"; player.play(); + player.currentTime = body.Start document.getElementById("Status").innerHTML = "Playing"; })); } @@ -46,3 +47,9 @@ function ToggleInfo() { isInfoShown = true; } } + +function SetVolume() { + const player = document.getElementById("mainAudio"); + const slider = document.getElementById("volumeRange"); + player.volume = slider.value / 100; +} |
