feat(web): choose how the player draws the sound: bars, oscilloscope, Milkdrop
Settings has one choice, kept on the device, in place of the spectrogram switch: Spectrogram, Bars, Oscilloscope, Milkdrop or None. Whoever had turned the spectrogram off stays on None. - Bars: the classic spectrum, with a cap on each bar that waits and falls. - Oscilloscope: the wave of the sound as it plays. - Milkdrop: butterchurn and its presets fill the background of the full-screen player behind a veil. They are loaded only when chosen, change by themselves every 25 seconds or with a button, and give way to the spectrogram where WebGL is missing or the system asks for less motion. - The bar of the player keeps a small picture; for Milkdrop it is the spectrogram. - The analyser also hands over the wave and the audio node.
This commit is contained in:
parent
f25d8f0dcf
commit
1d19e014a3
1 changed files with 1230 additions and 68 deletions
|
|
@ -343,7 +343,7 @@ Back up the database and `sonda.toml`. Your music stays wherever you keep it.
|
|||
|
||||
## Web app
|
||||
|
||||
A web client lives in `web/` (React, Vite and shadcn/ui). It talks only to the Sonda server: no CDN, no external fonts, no analytics. With the app built into the binary (`make build`, or the Docker image) `sondad` serves it: open the address of the server, for example `http://127.0.0.1:8080`, and sign in. The page carries a strict Content-Security-Policy (only resources of the server itself, no inline scripts), cannot be framed and sends no referrer, and a link inside the app (`/admin/users`) works when you reload it. The player draws a live spectrogram of what is playing, in the browser, from the sound itself (Web Audio): the last seconds, low notes at the bottom, in the colour of this server or, for a friend's track, in the colour of the friend. It listens to the sound and changes nothing of it, and it is drawn only while something plays.
|
||||
A web client lives in `web/` (React, Vite and shadcn/ui). It talks only to the Sonda server: no CDN, no external fonts, no analytics. With the app built into the binary (`make build`, or the Docker image) `sondad` serves it: open the address of the server, for example `http://127.0.0.1:8080`, and sign in. The page carries a strict Content-Security-Policy (only resources of the server itself, no inline scripts), cannot be framed and sends no referrer, and a link inside the app (`/admin/users`) works when you reload it. The player draws a live picture of what is playing, in the browser, from the sound itself (Web Audio). Settings has a choice for it, kept on the device: a spectrogram (the last seconds, low notes at the bottom, the default), the classic bars with falling caps, an oscilloscope, Milkdrop, or nothing. The bars, the oscilloscope and the spectrogram take the colour of this server or, for a friend's track, the colour of the friend. Milkdrop fills the background of the full-screen player with the pictures Winamp made famous, drawn on the device with [butterchurn](https://github.com/jberg/butterchurn) (MIT) and its presets, which are part of the app: nothing is fetched from outside. It is loaded only when chosen, and anyone who asked the system for less motion gets the spectrogram instead, because the pictures flash. The player listens to the sound and changes nothing of it, and draws only while something plays.
|
||||
|
||||
To work on the interface itself, run the Vite dev server next to a running `sondad` (set `SONDA_URL` to where it listens: the default is `http://127.0.0.1:8080`):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue