Skip to content

Instantly share code, notes, and snippets.

@beefchimi
Created October 22, 2017 22:25
Show Gist options
  • Save beefchimi/8c487f8055c23fd2b7fceb85f051592d to your computer and use it in GitHub Desktop.
Save beefchimi/8c487f8055c23fd2b7fceb85f051592d to your computer and use it in GitHub Desktop.
Example of using Loop.js in the Extensible section
import SoundFx from '../../SoundFx';
export default function ExtensibleFeature() {
const target = document.getElementById('ExtensibleFeature');
target.addEventListener('mouseenter', () => {
SoundFx.Extensible.play();
});
target.addEventListener('mouseleave', () => {
SoundFx.Extensible.pause();
});
target.addEventListener('mousedown', () => {
SoundFx.Extensible.speed(1.5);
});
target.addEventListener('mouseup', () => {
SoundFx.Extensible.speed(1);
});
return target;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment