From 0efa566bfa3f4a62e43c8ca33a74b548b43edb05 Mon Sep 17 00:00:00 2001 From: JesseRWeigel Date: Mon, 16 Mar 2026 14:02:43 -0400 Subject: [PATCH] fix: mobile level-up modal scrollable and ambient music autoplay Level-up modal: - Make outer container scrollable (overflow-y-auto, items-start) - Reduce icon, text, and padding sizes on mobile (sm: breakpoints) - "Continue Adventure" button now always reachable on small screens Ambient music: - Use html5:true for music Howls (better autoplay behavior) - Move fade into onplay callback (only fade when actually playing) - Add onplayerror handler that retries on Howler "unlock" event - Fixes silent failure when browser blocks autoplay Co-Authored-By: Claude Opus 4.6 (1M context) --- client/src/components/game/HuntersPath.tsx | 26 +++++++++++----------- client/src/lib/audioManager.ts | 11 ++++++++- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/client/src/components/game/HuntersPath.tsx b/client/src/components/game/HuntersPath.tsx index 4b06499..ccb2a8d 100644 --- a/client/src/components/game/HuntersPath.tsx +++ b/client/src/components/game/HuntersPath.tsx @@ -3908,7 +3908,7 @@ export default function HuntersPath() { >
-
+
@@ -3922,7 +3922,7 @@ export default function HuntersPath() { +{levelUpState.statPointsGained} Stat Points Available!
{levelUpState.showStatAllocation && ( -
+

Allocate Your Stat Points

@@ -5731,8 +5731,8 @@ export default function HuntersPath() { {/* Spirit Binding Sequence Modal */} {spiritBindingState.isActive && ( -
-
+
+
{/* Background Effects */}
{/* Animated particles */} @@ -5994,8 +5994,8 @@ export default function HuntersPath() { {/* Level-Up Celebration Modal */} {levelUpState.isActive && ( -
-
+
+
{/* Background Effects */}
{/* Animated particles */} @@ -6028,28 +6028,28 @@ export default function HuntersPath() { {/* Main Content */}
{/* Celebration Background */} -
+
{/* Level Icon */} -
- +
+
{/* Level Up Text */} -

+

LEVEL UP!

-
+
Level {levelUpState.newLevel}
-
+
+{levelUpState.statPointsGained} Stat Points Available!
{/* Stat Allocation Section */} {levelUpState.showStatAllocation && ( -
+

Allocate Your Stat Points

diff --git a/client/src/lib/audioManager.ts b/client/src/lib/audioManager.ts index 22d3987..d93f2c6 100644 --- a/client/src/lib/audioManager.ts +++ b/client/src/lib/audioManager.ts @@ -184,16 +184,25 @@ class AudioManager { const music = new Howl({ src: [src], + html5: true, // Use HTML5 Audio for music (better for long tracks, helps with autoplay) volume: 0, loop, + onplay: () => { + music.fade(0, this._volume * 0.5, 1000); // crossfade in when actually playing + }, onloaderror: () => { // Fallback: ambient drone via Web Audio if (name === "ambient") this.startAmbientDrone(); }, + onplayerror: () => { + // Autoplay was blocked — retry on next user interaction + music.once("unlock", () => { + music.play(); + }); + }, }); music.play(); - music.fade(0, this._volume * 0.5, 1000); // crossfade in over 1s this.currentMusic = music; this.currentMusicName = name; }