2.2.0 • Published 20 days ago
tocada v2.2.0
Tocada JS
Touch Events with ease
It's dead simple to use
npm install tocada
/**
Add events for
swipe // fired before swipeleft, up, down, right events
swipeup
swiperight
swipedown
swipeleft
gesture // fired before any pinch or spread
pinch
spread
*/
import { useTouchEvents } from "tocada";
const swipeArea = useTouchEvents(querySelector | element);
/**
Remove events
*/
swipeArea.destroy();
detail
object
The above CustomEvent
s emit a detail
object with the following data
velocityX, // speed of x-axis movement
velocityY, // speed of y-axis movement
velocity, // speed of overall touch event
avgPressure, // touch pressure for the entire event
startPressure, // starting touch pressure for the event
endPressure, // ending touch pressure for the event
startTime, // datetime at the start of the event
endTime, // datetime at the end of the event
distanceX, // distance traveled over the x-axis
distanceY, // distance traveled over the y-axis
distance, // distance traveled in a straight line
startingElement,// first element touched
endingElement, // last element touched
touchedElements,// all of the element (including duplicates) touched during the event -- convert to a Set to make elements unique: new Set(touchedElements);
Help me out
I write a lot of open source software (some more useful than others). You can help me out by tossing me a few bucks to buy coffee.
2.2.0
20 days ago
2.1.1
20 days ago
2.1.0
21 days ago
2.0.0-alpha.3
23 days ago
2.0.0-alpha.2
23 days ago
2.0.1
23 days ago
2.0.0
23 days ago
2.0.0-alpha.1
23 days ago
1.0.0-beta.6
3 years ago
1.0.0-beta.5
3 years ago
1.0.0-beta.4
3 years ago
1.0.0-beta.3
3 years ago
1.0.0-beta.2
3 years ago
1.0.0-beta.1
3 years ago
0.0.0-alpha.3
3 years ago
0.0.0-alpha.2
3 years ago