
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Mobile Touch Library that contain drag/pinch/rotate/singlePinch/singleRotate gesture。
MTouch is a modern JavaScript mobile touch gesture library. It's simple, convenient and only 9k.
The library support 5 kinds of gesture.
Tips:Single finger operation is so useful as practice confirms.
all the event you can bind:
EVENT = [
'touchstart',
'touchmove',
'touchend',
'drag',
'dragstart',
'dragend',
'pinch',
'pinchstart',
'pinchend',
'rotate',
'rotatestart',
'rotatend',
'singlePinch',
'singlePinchstart',
'singlePinchend',
'singleRotate',·
'singleRotatestart',
'singleRotatend'
];
npm install mtouch --save
let mt = new MTouch(selector);
// bind the drag event;
mt.on('drag',e => {
});
// bind the singlePinch. but there must be a operator that is the element which you want to operate;
mt.on('singlePinch', e =>{
} , operator);
You can operate the element via the ev.delta(incremental motion) in callback's params;
// the global transform to store the state of ele;
let transform = {
x:0,
y:0,
scale:1,
rotate:0
}
MTouch('selector', ev => {
transform.x += ev.deltaX;
transform.y += ev.deltaY;
$(el).css('transform',
`translate3d(${transform.x}px,${transform.y}px,0px) scale(${transform.scale}) rotate(${transform.rotate}deg)`);
});
switchmtouch.switch(el,addButton);
Switch the operator to change the basepoint that will be used in singlePinch or singleRotate's calculation.
params:
// the element want to operate;
el: type: string or HTMLElement,
optional;
default: the el on create the instance;
// whether you want to add a button when use single gesture.
addButton: type: boolean,
optional,
default:true;
on/offmtouch.on(evName,handle,operator) / mtouch.off(evName,handler);
bind the event callback;
mtouch.on('drag',(ev)=>{
console.log(ev);
})
the ev of callback is:
ev = {
origin:TouchEvent,
eventType:'drag',
delta:{
deltaX : 1,
deltaY : 1,
}
}
destroymtouch.destroy();
unbind all the event that has band on el;
FAQs
Mobile Touch Library that contain drag/pinch/rotate/singlePinch/singleRotate gesture。
We found that mtouch 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.