otofx

web audio api · 4kb · 0 dependencies · MIT

otofx

22 interaction sounds. Zero audio files. Every one synthesized live in the browser.

npm install otofx view on npm →

press a cue

SCOPE
cue idle dur type

wired to your markup

data-oto-hover

data-oto-press + data-oto-release

install

$ npm install otofx

usage

markup

<button data-oto-press data-oto-release>Save</button>
<a data-oto-hover="tick">Docs</a>
<button data-oto-toggle aria-pressed="false">Dark mode</button>

script

import { bind, play } from "otofx";

bind();          // wires every data-oto-* attribute
play("success"); // or trigger a cue imperatively

cue reference