Voltar ao ranking

AlloyTeam/AlloyFinger

JavaScriptalloyteam.github.io/AlloyFinger/

Super tiny size multi-touch gestures library for the web.    You can touch this →

touchgesturealloyfingerfinger
Crescimento de estrelas
Estrelas
3.4k
Forks
539
Crescimento semanal
Issues
77
1k2k3k
mai. de 2016set. de 2019fev. de 2023jul. de 2026
Artefatosnpmnpm install alloyfinger
README

Preview

You can touch this → http://alloyteam.github.io/AlloyFinger/

Install

You can install it via npm:

npm install alloyfinger

Usage

var af = new AlloyFinger(element, {
    touchStart: function () { },
    touchMove: function () { },
    touchEnd:  function () { },
    touchCancel: function () { },
    multipointStart: function () { },
    multipointEnd: function () { },
    tap: function () { },
    doubleTap: function () { },
    longTap: function () { },
    singleTap: function () { },
    rotate: function (evt) {
        console.log(evt.angle);
    },
    pinch: function (evt) {
        console.log(evt.zoom);
    },
    pressMove: function (evt) {
        console.log(evt.deltaX);
        console.log(evt.deltaY);
    },
    swipe: function (evt) {
        console.log("swipe" + evt.direction);
    }
});

/**
 * this method can also add or remove the event handler
 */
var onTap = function() {};

af.on('tap', onTap);
af.on('touchStart', function() {});

af.off('tap', onTap);

/**
 * this method can destroy the instance
 */
af = af.destroy();

Omi Version:

import { render, tag, WeElement } from 'omi'
import 'omi-finger'

@tag('my-app')
class MyApp extends WeElement {
  install() {
    this.data.wording = 'Tap or Swipe Me!'
  }

  handleTap = (evt) => {
    this.data.wording += '\r\nTap'
    this.update()
  }

  handleSwipe = (evt) => {
    this.data.wording += '\r\nSwipe-' + evt.direction
    this.update()
  }

  render() {
    return (
      <div>
        <omi-finger onTap={this.handleTap} abc={{a:1}} onSwipe={this.handleSwipe}>
          <div class="touchArea" >
            {this.data.wording}
          </div>
        </omi-finger>
      </div>
    )
  }

  css() {
    return `.touchArea{
                  background-color: green;
                  width: 200px;
                  min-height: 200px;
                  text-align: center;
                  color:white;
                  height:auto;
                  white-space: pre-line;
              }`
  }
}

render(<my-app></my-app>, 'body')

Others

License

This content is released under the MIT License.

Repositórios relacionados
nolimits4web/swiper

Most modern mobile touch slider with hardware accelerated transitions

TypeScriptnpmMIT Licenseswipeswiper
swiperjs.com
41.9k9.6k
SortableJS/Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

JavaScriptnpmMIT Licensedragsortable
sortablejs.github.io/Sortable/
31.2k3.7k
framework7io/framework7

Full featured HTML framework for building iOS & Android apps

JavaScriptnpmMIT Licenseframeworkios
framework7.io
18.7k3.2k
taye/interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

TypeScriptnpmMIT Licensedrag-and-dropinertia
interactjs.io
12.9k805
AlloyTeam/Mars

腾讯移动 Web 前端知识库

MIT Licensemobiletouch
9.7k1.9k
davidjerleke/embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.

TypeScriptnpmMIT Licensecarouselslider
embla-carousel.com
8.4k257
fancyapps/fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

JavaScriptnpmfancyboxlightbox
fancyapps.com
7.2k1.7k
rcbyr/keen-slider

The HTML touch slider carousel with the most native feeling you will get.

TypeScriptnpmMIT Licenseslidercarousel
keen-slider.io
5k216
Toxblh/MTMR

🌟 [My TouchBar My rules]. The Touch Bar Customisation App for your MacBook Pro

SwiftMIT Licensetouchbarmacos
mtmr.app
4.3k231
AlloyTeam/PhyTouch

Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - 丝般顺滑的触摸运动方案

JavaScriptnpmMIT Licensetouchscrolling
alloyteam.github.io/PhyTouch/
3k515
kornelski/slip

Slip.js — UI library for manipulating lists via swipe and drag gestures

JavaScriptnpmBSD 2-Clause "Simplified" Licensereorderingswipe
2.4k210
zingchart/zingtouch

A JavaScript touch gesture detection library for the modern web

JavaScriptnpmMIT Licensegesturetouch
zingchart.github.io/zingtouch/
2.1k130