play random sounds after a transaction - #243
Conversation
The default is still only the 'ka-ching' sound. To add more sounds you need
to place your sound files next to the `ka-ching.wav` file and then add the
filename to the sounds in the `sounds-config.json` file.
E.g. (sounds-config.json):
```json
{
"sounds":["ka-ching.wav", "mario-coin.wav"]
}
```
|
Hi! Thanks for your PR.. but I think this is not the right spot for it. The backend has a settings-endpoint: Which serves these settings to the frontend: In my opinion there should be something like a sounds folder or sth. like that inside And the files should be configured inside the strichliste.yml. Maybe it's clever to add a config parameters So you can even configure different ones for deposit and dispense? |
|
Good points! I'll implement the feedback. 👍 |
The sounds can now be configured via the backend config and are loaded from the 'sounds' folder. It's also possible to configure different sounds for dispense and deposit.
|
I've implemented the suggestions. I hope this code is ok. I'm not that proficient in React. |
Context
We @Nerdbergev wanted the strichliste to play different sounds after purchasing an item. This is the result of my quick attempt at implementing this feature. I'm not that advanced at web development though so feel free to tell me if I need to change anything.
Feature
The default is still only the 'ka-ching' sound. To add more sounds you need
to place your sound files into the 'sounds' folder next to the
ka-ching.wavfile and then add thefilename to the sounds in the
strichliste.yaml.It's now also possible to configure different sounds for dispenses and deposits.
This PR requires this backend change first: strichliste/strichliste-backend#76