Skip to content

craigmulligan/morse-vibes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vibes 📳

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

The default 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

About

Tiny library that converts dot-dash notation to the browser vibration API 📳

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published