feat(waybar): hide groups based on screen size

This commit is contained in:
Pihkaal
2024-08-22 14:57:13 +02:00
parent 67a03668a4
commit 03d90db620
6 changed files with 95 additions and 43 deletions

View File

@@ -3,10 +3,14 @@ import { type IAudioMetadata, parseBlob } from "music-metadata-browser";
import { Kitty } from "../Kitty";
import { SpotifyPlayer } from "./SpotifyPlayer";
import { Cava } from "./Cava";
import { useApp } from "~/hooks/useApp";
import { Responsive } from "../Responsive";
const song = "/audio/asinine-vivement-quoi.mp3";
export const Music = () => {
const { volume } = useApp();
const audio = useRef<HTMLAudioElement>(null);
const [metadata, setMetadata] = useState<IAudioMetadata>();
@@ -40,6 +44,12 @@ export const Music = () => {
});
}, [metadata]);
useEffect(() => {
if (audio.current) {
audio.current.volume = volume / 400;
}
}, [volume]);
return (
<div className="flex flex-row">
<audio ref={audio} src={song} onTimeUpdate={handleTimeUpdate} loop />