
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
alloyfinger-typescript
Advanced tools
super tiny size multi-touch gestures library for the web. Cloned from alloyfinger
This is the Typescript port of the useful AlloyFinger touch library
→ https://github.com/AlloyTeam/AlloyFinger/
You can install it via npm:
npm install alloyfinger-typescript
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();
import AlloyFinger, { TouchMoveEvent,
TouchPinchEvent,
TouchPressMoveEvent,
TouchRotateEvent,
TouchSwipeEvent } from "alloyfinger-typescript/src/ts/index";
new AlloyFinger( document.getElementsByTagName('body')[0], {
touchStart: (_evt : TouchEvent) =>
console.log('touchStart'),
touchMove: (evt : TouchMoveEvent) =>
console.log('touchMove', evt.deltaX.toFixed(4), evt.deltaY.toFixed(4)),
touchEnd: (_evt: TouchEvent) =>
console.log('touchEnd'),
tap: (_evt : TouchEvent) =>
console.log('tap'),
doubleTap: (evt : TouchEvent) =>
console.log('doubleTap', evt.touches[0].clientX.toFixed(4), evt.touches[0].clientY.toFixed(4)),
longTap: (_evt : TouchEvent) =>
console.log('longTap'),
singleTap: (_evt : TouchEvent) =>
console.log('singleTap'),
rotate: (evt : TouchRotateEvent) =>
console.log('rotate', evt.angle ),
pinch: (evt : TouchPinchEvent) =>
console.log('pinch', evt.zoom),
pressMove: (evt : TouchPressMoveEvent) =>
console.log('pressMove', evt.deltaX.toFixed(4), evt.deltaY.toFixed(4)),
swipe: (evt : TouchSwipeEvent) =>
console.log('swipe', evt.direction ),
multipointStart: (_evt : TouchEvent) =>
console.log('multiPointStart'),
multipointEnd: (_evt : TouchEvent) =>
console.log('multiPointEnd'),
twoFingerPressMove: (evt: TouchPressMoveEvent) =>
console.log('twoFingerPressMove', evt.deltaX.toFixed(4), evt.deltaY.toFixed(4)),
touchCancel: (_evt : TouchEvent) =>
console.log('touchEnd')
} );
Have fun and do good!
This content is released under the MIT License.
FAQs
super tiny size multi-touch gestures library for the web. Cloned from alloyfinger
The npm package alloyfinger-typescript receives a total of 18 weekly downloads. As such, alloyfinger-typescript popularity was classified as not popular.
We found that alloyfinger-typescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.