{"id":21239214,"url":"https://github.com/tinacious/jquery-navigator-vibrate","last_synced_at":"2026-03-19T19:25:51.124Z","repository":{"id":57282251,"uuid":"264347290","full_name":"tinacious/jquery-navigator-vibrate","owner":"tinacious","description":"jQuery plugin that leverages navigator.vibrate() to support adding vibrations to websites","archived":false,"fork":false,"pushed_at":"2022-12-12T19:23:51.000Z","size":133,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T01:16:31.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tinacious.github.io/jquery-navigator-vibrate","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinacious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-16T03:03:17.000Z","updated_at":"2020-08-04T13:38:42.000Z","dependencies_parsed_at":"2023-01-28T00:15:42.161Z","dependency_job_id":null,"html_url":"https://github.com/tinacious/jquery-navigator-vibrate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinacious%2Fjquery-navigator-vibrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinacious%2Fjquery-navigator-vibrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinacious%2Fjquery-navigator-vibrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinacious%2Fjquery-navigator-vibrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinacious","download_url":"https://codeload.github.com/tinacious/jquery-navigator-vibrate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243680974,"owners_count":20330154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T00:42:28.623Z","updated_at":"2026-01-02T00:53:02.206Z","avatar_url":"https://github.com/tinacious.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📳 jquery-navigator-vibrate\n\n![CI](https://github.com/tinacious/jquery-navigator-vibrate/workflows/CI/badge.svg?branch=master)\n\nA light wrapper around `window.navigator.vibrate()` so you can use it with jQuery.\n\n👉 **[View demo](https://tinacious.github.io/jquery-navigator-vibrate/)**\n\n- [Browser support](#browser-support)\n- [Usage](#usage)\n  - [Installation](#installation)\n  - [Implementation](#implementation)\n  - [Options](#options)\n    - [`time`](#time)\n    - [`style`](#style)\n      - [`constant`](#constant)\n      - [`pulse`](#pulse)\n      - [`list`](#list)\n    - [`pulseCount`](#pulsecount)\n    - [`pulseInterval`](#pulseinterval)\n    - [`event`](#event)\n    - [`onVibrateComplete`](#onvibratecomplete)\n- [Development](#development)\n  - [Run the dev server](#run-the-dev-server)\n  - [Run the TypeScript compilation](#run-the-typescript-compilation)\n\n\n## Browser support\n\nAt the time of publishing, [browser support](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API#Browser_compatibility) is limited to Chrome, Edge, and Android browsers.\n\nSafari and Safari on iOS do not currently support `window.navigator.vibrate()`.\n\n\n## Usage\n\n### Installation\n\nDownload the package and import the `./lib/jquery-navigator-vibrate.js` file after jQuery.\n\nYou can also install via NPM:\n\n```\nnpm install jquery-navigator-vibrate --save\n```\n\nOr Yarn:\n\n```\nyarn add jquery-navigator-vibrate\n```\n\nAdd it to your build tooling and insure it loads in the browser.\n\n\n### Implementation\n\nFind an element with jQuery and execute the plugin with options:\n\n```js\n$('.js-vibrating-btn').vibrate({\n  time: 300,\n  style: 'constant',\n  event: 'click',\n  pulseCount: 3,\n  pulseInterval: 300,\n  onVibrateComplete: function () {}\n});\n```\n\nIt assumes you have HTML as follows:\n\n```html\n\u003cbutton class=\"js-vibrating-btn\"\u003eclick me\u003c/button\u003e\n```\n\n### Options\n\n#### `time`\n\n- Integer (default: 300)\n- Integer list, e.g. `[100, 200, 300]`\n\nTime in milliseconds for the length of the vibration or a list of integers.\n\n\n#### `style`\n\nEnum ( constant | pulse | list ) (default: constant)\n\n##### `constant`\n\nA single vibration for the time specified\n\n##### `pulse`\n\nA number of vibrations. Uses properties `pulseCount` and `pulseInterval`.\n\n##### `list`\n\nAn array of numbers. This is an alternative to using `pulse`. To learn about this method, read the documentation for the [Vibration API](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API#Vibration_patterns).\n\n#### `pulseCount`\n\nInteger (default: 3)\n\nNumber of times to vibrate.\n\n\n#### `pulseInterval`\n\nInteger (default: 300)\n\nTime in milliseconds for the length of the interval between vibrations.\n\n\n#### `event`\n\nString (default: click)\n\nThe DOM event to listen to, i.e. `$(selector).on(event)`\n\n\n#### `onVibrateComplete`\n\nFunction\n\nAn optional function to call when the vibration is complete.\n\n\n## Development\n\nYou'll need to run 2 terminal windows:\n\n\n### Run the dev server\n\nThis hosts the `index.html` file and points to the compiled library.\n\n```\nnpm start\n```\n\n### Run the TypeScript compilation\n\nThis runs the TypeScript compilation and outputs it to `./lib/jquery-navigator-vibrate.js`\n\n```\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinacious%2Fjquery-navigator-vibrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinacious%2Fjquery-navigator-vibrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinacious%2Fjquery-navigator-vibrate/lists"}