Skip to content

Instantly share code, notes, and snippets.

@beefchimi
Last active October 22, 2017 23:42
Show Gist options
  • Save beefchimi/d381556b7e17f96f3d6f16504d647899 to your computer and use it in GitHub Desktop.
Save beefchimi/d381556b7e17f96f3d6f16504d647899 to your computer and use it in GitHub Desktop.
Basic Single class implementation
import SoundFx from '../../SoundFx';
export default function AnimationFeature() {
const target1 = document.getElementById('AnimationCube1');
// ...more targets...
target1.addEventListener('mouseenter', () => {
SoundFx.Single.play('animationUp1');
});
// ...more mouseenter listeners...
target1.addEventListener('mousedown', () => {
SoundFx.Single.play('animationDown1');
});
// ...more mousedown listeners...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment