Add featured Dark House track with default landing ambient playback
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Wire featured-dark-house-2025.mp3 as the default ambient source, enable BGM for first-time visitors, and attempt autoplay on Command Deck with gesture-unlock fallback. The ~57MB MP3 stays gitignored; copy instructions are in public/audio/.gitkeep.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useAmbientMusic } from '../context/AmbientMusicContext';
|
||||
import { resolvePageAmbientIntensity } from '../audio/ambientMusic';
|
||||
import { ambientMusicPlayer, FEATURED_MUSIC_TITLE, resolvePageAmbientIntensity } from '../audio/ambientMusic';
|
||||
import './GlobalMusicPlayer.css';
|
||||
|
||||
export default function GlobalMusicPlayer() {
|
||||
@@ -14,13 +14,19 @@ export default function GlobalMusicPlayer() {
|
||||
setPageIntensity(routeIntensity);
|
||||
}, [routeIntensity, setPageIntensity]);
|
||||
|
||||
useEffect(() => {
|
||||
const path = location.pathname.split('?')[0].replace(/\/$/, '') || '/';
|
||||
if (path === '/dashboard') void ambientMusicPlayer.tryPlay();
|
||||
}, [location.pathname]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`global-music-player${isDim ? ' global-music-player--ambient-dim' : ''}`}
|
||||
data-sfx="off"
|
||||
data-ambient-intensity={pageIntensity.toFixed(2)}
|
||||
role="region"
|
||||
aria-label="Background music controls"
|
||||
aria-label={`Background music — ${FEATURED_MUSIC_TITLE}`}
|
||||
title={FEATURED_MUSIC_TITLE}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user