vibes
v0.1.1
Published
Downloads
5
Readme
This is a tiny library that converts dotdash notation to the browser vibration API 📳
The mapping is as follows:
| symbol | value |
| ---------------- | ------------------ |
| _
| 1s vibration |
| .
| 500ms vibration |
|
(space) | 500ms no vibration |
All no space characters are seperated by a 30ms space. (see tests for details)
const vibes = require('vibes')
vibes('_. ._') // will create the following vibration pattern. [1000, 30, 500, 1000, 500, 30, 1000]
// with custom mapping
const mapping = {
_: 500,
'.': 250,
' ': 250,
'~': 10, // the tilda is used as the small gap between vibration characters
}
vibes('_. ._', { mapping })
There are also browser compatible bundles in /dist