Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sound effect component #7

Merged
merged 21 commits into from
Sep 11, 2024
Merged

sound effect component #7

merged 21 commits into from
Sep 11, 2024

Conversation

C-Sinclair
Copy link
Contributor

@C-Sinclair C-Sinclair commented May 2, 2024

Changes

This PR implements a component for triggering sound effects in the user's browser

Implementation

The UI component itself SoundEffect.sound_effect/1 is a simple button which toggles the user preference for sound effects. The SoundEffect module also exposes a play_sound/1 function, which can be called from the parent Liveview to trigger sounds to be played in a user's browser purely from Elixir land!

Outside of the scope of Bloom, but I'm imagining this component to be hooked up to the consuming app's PubSub system, so this LiveComponent can ping sound effects for users when backend events take place.

Note

Storybook does not allow for custom :live_views, so the triggering of sound effects is somewhat limited. You can see that it works by toggling the button itself - the pop.mp3 file will play/

@C-Sinclair C-Sinclair marked this pull request as ready for review May 6, 2024 22:42
@chrisgreg chrisgreg merged commit 824eace into chrisgreg:main Sep 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants