Skip to content

seanockert/web-haptics-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WebHaptics JS

Haptic feedback for the mobile web in vanilla JS.

Adopted from web-haptics by lochie.

Same API but without a build step or Typescript, so you can throw it into any webapp.

Demo

haptics.seanockert.com

Usage

  <script type="module">
    import { createHaptics } from "./web-haptics-js.min.js";
    const { trigger } = createHaptics();

    document.querySelector("button").addEventListener("click", () => {
      trigger("medium");
    });
  </script>

CDN link

Direct link to the minified version: https://cdn.jsdelivr.net/gh/seanockert/web-haptics-js@1.0.0/web-haptics-js.min.js

Documentation

Use the prebuilt patterns eg. trigger('success') or design your own eg. trigger([{ duration: 10 }], { intensity: 1 })

See the original library website for more details

About

Haptic feedback for the mobile web in vanilla JS

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors