Accessors
note
All Module accessors are available in this class.
accum
Type: ISwipeVec2
Accumulated movement.
Returns the current swipe coordinates.
const instance = new Swipe();
instance.accum.x;
instance.accum.y;
container
Type: HTMLElement | SVGElement
Event target element.
const instance = new Swipe();
instance.container; // returns swipe container element
coords
Type: ISwipeCoords
const instance = new Swipe();
instance.coords; // returns all coordinates data
current
Type: ISwipeMatrix
Current coordinate.
const instance = new Swipe();
instance.current.x;
instance.current.y;
instance.current.angle;
diff
Type: ISwipeMatrix
Difference between start and current coordinates.
const instance = new Swipe();
instance.diff.x;
instance.diff.y;
instance.diff.angle;
hasInertia
Type: boolean
Indicates if inertia is active.
const instance = new Swipe();
instance.hasInertia; // true or false
isSwiping
Type: boolean
Indicates if a swipe is active.
const instance = new Swipe();
instance.isSwiping; // true or false
prev
Type: ISwipeMatrix
Previous coordinate.
const instance = new Swipe();
instance.prev.x;
instance.prev.y;
instance.prev.angle;
start
Type: ISwipeMatrix
Start coordinate.
const instance = new Swipe();
instance.start.x;
instance.start.y;
instance.start.angle;
step
Type: ISwipeMatrix
Difference between current and previous coordinates.
const instance = new Swipe();
instance.step.x;
instance.step.y;
instance.step.angle;