Skip to content

Update "displaySoundButton" function to toggle sound on/off #10

@hattifnatt4r

Description

@hattifnatt4r

Update "displaySoundButton" to toggle sound on/off when clicked:

  • Add "soundName" parameter to the function
  • Create a variable "soundOn" inside the function
  • Add click event to the button, to toggle soundOn
  • When soundOn is true, show the button background and start the sound

Sound URL example: https://devclass-projects-public.s3.us-east-2.amazonaws.com/ambient-app--react/heavy_rain.wav
(You can see available sounds at https://devclass-projects-public.s3.us-east-2.amazonaws.com)

Image Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions