Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

kotasjs

borecjeborec18MIT1.0.3

The first open-source mouse gestures library

mouse, mouse gestures, gestures, mouse events, document, dom, events

readme

KotasJS

The only Javascript mouse gestures library!

Visit website KotasJS

Install

Via Npm
npm i kotasjs

PS: KotasJS uses document.addEventListener in the background, so you need to have access to your document with your npm package.

Via CDN
<script src="https://cdn.jsdelivr.net/gh/borecjeborec1/kotasjs/cdn/kotasjs.min.js"></script>

Usage

const kotas = new KotasJS()

// Listen to all mouse gestures
kotas.on("*", (e) => {
 alert(e.event)
})

// Listen to Swipe Down event
kotas.on("swipe_down", (e) => {
 alert(e.event)
})

// Listen to Swipe Up event
kotas.on("swipe_up", (e) => {
 alert(e.event)
})

// Listen to Swipe Left event
kotas.on("swipe_left", (e) => {
 alert(e.event)
})

// Listen to Swipe Right event
kotas.on("swipe_right", (e) => {
 alert(e.event)
})