diff --git a/Makefile b/Makefile index 30d78a2d..acd438c1 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ BIN ?= go-mud-server DOCKER_COMPOSE := docker-compose -f provisioning/docker-compose.yml export GOFLAGS := -mod=mod -export GOSUMDB := off ## Build Targets diff --git a/_datafiles/html/public/webclient.html b/_datafiles/html/public/webclient.html index 0a9cc8d2..b9040539 100644 --- a/_datafiles/html/public/webclient.html +++ b/_datafiles/html/public/webclient.html @@ -8,7 +8,7 @@ margin: 0; padding: 0; } - + body { margin: 0; padding: 0; @@ -17,6 +17,7 @@ display: flex; flex-direction: column; background-color: #1e1e1e; + position: relative; /* So absolutely positioned children can be placed relative to */ } /* Ensure the main container is positioned relatively */ @@ -29,7 +30,6 @@ background-color: #000; } - /* Adjust text-output to flex properly */ #terminal { flex: 1; } @@ -62,7 +62,6 @@ #connect-button:disabled { color: #888; pointer-events: none; - animation: none; background-color: #555; cursor: not-allowed; @@ -73,7 +72,7 @@ color: white; } 100% { - color:#d17a7a; + color: #d17a7a; background-color: #9f4a4a; } } @@ -81,13 +80,79 @@ #command-input:focus { outline: none; } + + /* Sound icon in top-right corner */ + #menu-icon { + position: absolute; + top: 10px; + right: 10px; + font-size: 26px; + color: white; + padding: 10px; + cursor: pointer; + z-index: 9999; + /* Optional background to make it stand out: */ + background-color: rgba(30,30,30, 0.8); + border-radius: 5px; + } + + /* The floating menu container */ + #floating-menu { + position: absolute; + top: 60px; /* Just below the icon */ + right: 10px; + width: 300px; + padding: 10px; + background-color: #2e2e2e; + border: 1px solid #444; + border-radius: 5px; + display: none; /* hidden by default */ + z-index: 9999; + } + #floating-menu h3 { + color: #fff; + margin-bottom: 10px; + } + + .slider-container { + margin-bottom: 15px; + display: flex; + align-items: center; + } + .slider-container label { + color: #ccc; + width: 70px; + } + .slider-container input[type="range"] { + flex: 1; + margin: 0 10px; + } + .slider-icon { + width: 32px; + text-align: center; + font-size: 20px; + color: #ccc; + } + + + + + + +
+

Volume Controls

+
+ +
+
+
@@ -97,12 +162,15 @@ - - - \ No newline at end of file + diff --git a/_datafiles/html/static/public/audio/music/_TODO11.mp3 b/_datafiles/html/static/public/audio/music/_TODO11.mp3 index 4ec2b494..6238405a 100644 Binary files a/_datafiles/html/static/public/audio/music/_TODO11.mp3 and b/_datafiles/html/static/public/audio/music/_TODO11.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO14.mp3 b/_datafiles/html/static/public/audio/music/_TODO14.mp3 new file mode 100644 index 00000000..029f7c05 Binary files /dev/null and b/_datafiles/html/static/public/audio/music/_TODO14.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO15.mp3 b/_datafiles/html/static/public/audio/music/_TODO15.mp3 new file mode 100644 index 00000000..6cd34cce Binary files /dev/null and b/_datafiles/html/static/public/audio/music/_TODO15.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO16.mp3 b/_datafiles/html/static/public/audio/music/_TODO16.mp3 new file mode 100644 index 00000000..6c3ecb98 Binary files /dev/null and b/_datafiles/html/static/public/audio/music/_TODO16.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO17.mp3 b/_datafiles/html/static/public/audio/music/_TODO17.mp3 new file mode 100644 index 00000000..095d7be6 Binary files /dev/null and b/_datafiles/html/static/public/audio/music/_TODO17.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO2.mp3 b/_datafiles/html/static/public/audio/music/_TODO2.mp3 new file mode 100644 index 00000000..e0bf5fe0 Binary files /dev/null and b/_datafiles/html/static/public/audio/music/_TODO2.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/_TODO9.mp3 b/_datafiles/html/static/public/audio/music/_TODO9.mp3 index 59e364c1..8d426b3c 100644 Binary files a/_datafiles/html/static/public/audio/music/_TODO9.mp3 and b/_datafiles/html/static/public/audio/music/_TODO9.mp3 differ diff --git a/_datafiles/html/static/public/audio/music/dark-forest.mp3 b/_datafiles/html/static/public/audio/music/dark-forest.mp3 index 6238405a..4ec2b494 100644 Binary files a/_datafiles/html/static/public/audio/music/dark-forest.mp3 and b/_datafiles/html/static/public/audio/music/dark-forest.mp3 differ diff --git a/_datafiles/html/static/public/js/mp3.js b/_datafiles/html/static/public/js/mp3.js index 46eeb068..fe7a928f 100644 --- a/_datafiles/html/static/public/js/mp3.js +++ b/_datafiles/html/static/public/js/mp3.js @@ -12,6 +12,11 @@ class MP3Player { this.stopAll(); } + // Ensure volume doesn't exceed 1.0 + if (volume > 1.0) { + volume = 1.0; + } + let audio; if (this.audioCache.has(url)) { audio = this.audioCache.get(url); @@ -25,7 +30,10 @@ class MP3Player { audio.loop = loop; audio.volume = volume; audio.play().catch((e) => console.error("Playback failed:", e)); + + // Keep track of currently playing audio this.activeAudios.add(audio); + this.currentUrl = url; } @@ -53,6 +61,7 @@ class MP3Player { } setVolume(url, level) { + // Set volume for a specific URL (if needed) if (level < 0 || level > 1) { console.error("Volume must be between 0 and 1"); return; @@ -62,6 +71,17 @@ class MP3Player { } } + setGlobalVolume(level) { + // Set volume for any currently playing audio + if (level < 0 || level > 1) { + console.error("Volume must be between 0 and 1"); + return; + } + this.activeAudios.forEach(audio => { + audio.volume = level; + }); + } + setLoop(url, loop) { if (this.audioCache.has(url)) { this.audioCache.get(url).loop = loop;