0.1.1 • Published 5 years ago

vibes v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

This is a tiny library that converts dotdash notation to the browser vibration API 📳

The mapping is as follows:

symbolvalue
_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

0.1.1

5 years ago

0.1.0

5 years ago

0.2.0

10 years ago