Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

fork-from-others-coder/AlloyFinger

 
 

Repository files navigation

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

Install

You can install it via npm:

npm install alloyfinger

Usage

varaf=newAlloyFinger(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 */varonTap=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')classMyAppextendsWeElement{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.directionthis.update()}render(){return(<div><omi-fingeronTap={this.handleTap}abc={{a:1}}onSwipe={this.handleSwipe}><divclass="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 theMIT License.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript85.4%
  • HTML14.6%

[8]ページ先頭

©2009-2025 Movatter.jp