DEV Community

Calvin
Calvin

Posted on

2

Reading Snippets [57 => Navigator.vibrate] 📱

I came across an interesting tweet by Eddy Vinick, also known as @veinq_ on Twitter. Thanks to his tweet, I learned that Twitter uses Navigator.vibrate(x) on its website to make your phone vibrate when you like a tweet:

window.navigator.vibrate(200);

I decided to do some more research into this cool piece of code and I found out some more interesting tidbits:

🕺 Within the parentheses of the method, a pattern (value) is provided to determine the number of seconds to vibrate or pause.

🕺 The vibration API is specifically made for mobile devices

🕺 The navigator.vibrate is not compatible with Internet Explorer, Opera, and Safari on desktop.

🕺 The navigator.vibrate method is not compatible with Safari on IOS.

SRC: Mozilla Documentation

AWS Q Developer image

Your AI Code Assistant

Implement features, document your code, or refactor your projects.
Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay