feat: alive UI wave, galaxy presence, spread and fleet enhancements
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
Dashboard ambient layer, comrade presence, Mission Deck and War Room, Emberwake supply chain, spread/docs publishing, fleet policy and modules API, CI docker mining, and refreshed USB pack.
This commit is contained in:
@@ -1,13 +1,24 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useAmbientMusic } from '../context/AmbientMusicContext';
|
||||
import { resolvePageAmbientIntensity } from '../audio/ambientMusic';
|
||||
import './GlobalMusicPlayer.css';
|
||||
|
||||
export default function GlobalMusicPlayer() {
|
||||
const { enabled, playing, volume, setVolume, togglePlay } = useAmbientMusic();
|
||||
const { enabled, playing, volume, setVolume, togglePlay, setPageIntensity, pageIntensity } = useAmbientMusic();
|
||||
const location = useLocation();
|
||||
const routeIntensity = resolvePageAmbientIntensity(location.pathname);
|
||||
const isDim = routeIntensity < 0.5;
|
||||
|
||||
useEffect(() => {
|
||||
setPageIntensity(routeIntensity);
|
||||
}, [routeIntensity, setPageIntensity]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className="global-music-player"
|
||||
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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user