Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio / Tactile Feedback #10

Open
FeXd opened this issue Apr 14, 2023 · 1 comment
Open

Audio / Tactile Feedback #10

FeXd opened this issue Apr 14, 2023 · 1 comment

Comments

@FeXd
Copy link
Owner

FeXd commented Apr 14, 2023

Add "haptic feedback" (iOS term) to slightly vibrate device after each move. Consider adding audio for pieces moving as well, but could be annoying.

@FeXd
Copy link
Owner Author

FeXd commented Feb 17, 2024

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.

😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant