@hackkun/touch
手势库,支持移动端和 PC 端,只支持 import 方式引用
介绍
- 移动端事件:start end tap singleTap doubleTap longTap drag swipe pinch rotate
- PC 端事件:start end tap singleTap doubleTap longTap drag swipe wheelStart wheel wheelEnd
- 自定义 event 扩展了:
- drag 下 deltaX,deltaY
- swipe 下 Left Right Up Down
- wheel 和 pinch 下 ratio
使用
import { HackTouchMobile, HackTouchPc } from '@hackkun/touch'
const ht = new HackTouchMobile(idName)
ht.on(EventName, (Event) => {})