var deltax = mouse.x - startX;
var deltay = mouse.y - startY;
- if (Math.abs(deltax) > 40 || Math.abs(deltay) > 40) {
- if (deltax > 30 && Math.abs(deltay) < 30) {
+ if (Math.abs(deltax) > 30 || Math.abs(deltay) > 30) {
+ if (deltax > 20 && Math.abs(deltay) < 20) {
// swipe right
swipeRight();
- } else if (deltax < -30 && Math.abs(deltay) < 30) {
+ } else if (deltax < -20 && Math.abs(deltay) < 20) {
// swipe left
swipeLeft();
- } else if (Math.abs(deltax) < 30 && deltay > 30) {
+ } else if (Math.abs(deltax) < 20 && deltay > 20) {
// swipe down
swipeDown();
- } else if (Math.abs(deltax) < 30 && deltay < 30) {
+ } else if (Math.abs(deltax) < 20 && deltay < 20) {
// swipe up
swipeUp();
}