Add visual and vibration feedback to buttons
This commit is contained in:
parent
20cea84056
commit
4285f6aa1b
3 changed files with 23 additions and 0 deletions
|
|
@ -74,3 +74,9 @@ export const addPointerlockchangeEventListener = (listener) => {
|
|||
document.addEventListener("pointerlockchange", listener);
|
||||
}
|
||||
};
|
||||
|
||||
export const vibrate = (pattern) => {
|
||||
if (navigator.vibrate) {
|
||||
navigator.vibrate(pattern);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue