Add visual and vibration feedback to buttons

This commit is contained in:
Unrud 2023-04-25 01:38:51 +02:00
parent 20cea84056
commit 4285f6aa1b
3 changed files with 23 additions and 0 deletions

View file

@ -74,3 +74,9 @@ export const addPointerlockchangeEventListener = (listener) => {
document.addEventListener("pointerlockchange", listener);
}
};
export const vibrate = (pattern) => {
if (navigator.vibrate) {
navigator.vibrate(pattern);
}
};