Open FeXd opened 1 year ago
JavaScript has a vibrate API: https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API
function triggerVibration() {
if ('vibrate' in navigator) {
// Vibrate for 500 milliseconds
navigator.vibrate(500);
} else {
console.log("Vibration API not supported on this device.");
}
}
triggerVibration();
Currently there is no support for Safari both on Desktop and Mobile.
😢
Add "haptic feedback" (iOS term) to slightly vibrate device after each move. Consider adding audio for pieces moving as well, but could be annoying.