Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kcmr/good-vibrations

Web Component that uses the Vibration API in browsers that support it
https://github.com/kcmr/good-vibrations

mobile polymer polymer-2x vibration-api web-components

Last synced: 13 days ago
JSON representation

Web Component that uses the Vibration API in browsers that support it

Awesome Lists containing this project

README

        

# <good-vibrations>

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg?style=flat-square)](https://www.webcomponents.org/element/kcmr/good-vibrations)

> `` is a component meant to be used as a singleton, that uses the [Vibration API](https://developer.mozilla.org/docs/Web/API/Vibration_API) to emit vibrations in browsers that support it.
__[<good-vibrations> demo](http://kcmr.github.io/good-vibrations/)__


Live demo

## Installation and import

Install the component using [Bower](http://bower.io/):

```bash
$ bower i -S good-vibrations
```

Import Web Components loader (optional) and the component:

```html


```

## Usage

__Example:__
```html

```

__Example with vibration / silence intervals:__
```html

```

__Canceling any running vibration:__
```js
document.querySelector('good-vibrations').cancel();
```

Or declaratively using the boolean attribute `mute`:
```html

```

__Get Vibration API support:__
```html

Vibration API not supported

```

## Development

browserSync and eslint support.
`eslint` and `eslint --fix` are enabled by default. Edit tasks/config.json to change the default configuration.

1. Install npm dependencies: `npm install`
2. Launch the component's demo: `npm run serve`