forked fromAlloyTeam/AlloyFinger
- Notifications
You must be signed in to change notification settings - Fork0
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
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
You can touch this →http://alloyteam.github.io/AlloyFinger/
You can install it via npm:
npm install alloyfinger
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();
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')
This content is released under theMIT License.
About
Super tiny size multi-touch gestures library for the web. You can touch this →
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Languages
- JavaScript85.4%
- HTML14.6%