Coder Social home page Coder Social logo

sciactive / tinygesture Goto Github PK

View Code? Open in Web Editor NEW
196.0 11.0 18.0 176 KB

Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate.

Home Page: https://sciactive.github.io/tinygesture/

License: Apache License 2.0

JavaScript 38.16% HTML 14.24% Shell 0.18% TypeScript 47.42%
events gesture javascript swipe touch double-tap gesture-recognition gesture-recognizer long-press pan

tinygesture's Issues

Disable gesture events in scrollable content

Hello
Thanks for the great library.
I have one small question:
Is it possible to disable gesture events inside scollable container?
Something like this:
I can swipe down this white element like in mobile apps, but i have scrollable content, which must disable swipe.
image

No swipe events with `diagonalSwipes: true`

I apologize in advance for a short and blunt bug report.

I spent a while debugging why tinygesture wasn't firing swipe events at all. It didn't matter how I swiped. Turned out to be due to diagonalSwipes being set to true.

I don't have a repro, it's late and I probably forget about this tomorrow with all the corona fuss, so that will be all.

Doubletap without Tap?

You showed how to implement a long press without Tap.

Is there a similar thing for a double tap without tap?

Thanks!

Swipe events does not fire.

Hi
I registered for all four swipe events, but surprisingly only the right one will fire. i don't if it's because of the touch pad or something else:

import TinyGesture from "https://unpkg.com/[email protected]/dist/TinyGesture.js";

function initSlider(target)
{
    const instance = new TinyGesture(target);
    console.log(instance)

    instance.on("swipeleft", async event => {
        console.log("swiped left")
    });
    
    instance.on("swiperight", async event => {
        console.log("swiped right")
    });
    
    instance.on("swipeup", async event => {
        console.log("swiped up")
    });
    
    instance.on("swipedown", async event => {
        console.log("swiped down")
    });
}

document.addEventListener("DOMContentLoaded", () => {
  document.querySelectorAll(".swipe").forEach(initSlider);
});

Detect number of touch points used

Hi,

Thanks for a great library. Already we are using it in production in a PWA with great results.

I would now like to support some more gestures to enrich what our users can do, specifically a two finger horizontal swipe. Is there any way to tell from the fired event the number of touchpoints used?

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.