
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
The 'gesto' npm package is a lightweight library for handling gesture events such as drag, pinch, and rotate. It provides a simple API to manage complex gesture interactions on web applications.
Drag
This feature allows you to handle drag events. The code sample demonstrates how to use 'gesto' to make an element draggable by updating its transform property based on the drag distance.
const Gesto = require('gesto');
const target = document.querySelector('.target');
const gesto = new Gesto(target);
gesto.on('drag', ({ distX, distY }) => {
target.style.transform = `translate(${distX}px, ${distY}px)`;
});
Pinch
This feature allows you to handle pinch events. The code sample shows how to use 'gesto' to scale an element based on pinch gestures.
const Gesto = require('gesto');
const target = document.querySelector('.target');
const gesto = new Gesto(target);
gesto.on('pinch', ({ scale }) => {
target.style.transform = `scale(${scale})`;
});
Rotate
This feature allows you to handle rotate events. The code sample demonstrates how to use 'gesto' to rotate an element based on rotation gestures.
const Gesto = require('gesto');
const target = document.querySelector('.target');
const gesto = new Gesto(target);
gesto.on('rotate', ({ angle }) => {
target.style.transform = `rotate(${angle}deg)`;
});
Hammer.js is a popular library for handling touch gestures. It supports a wide range of gestures including tap, double tap, swipe, pinch, and rotate. Compared to 'gesto', Hammer.js offers more built-in gesture recognizers and is more widely used in the community.
Interact.js is a powerful library for drag-and-drop, resizing, and multi-touch gestures. It provides a more comprehensive set of features for complex interactions compared to 'gesto', including inertia and snapping.
AlloyFinger is a lightweight library for handling touch gestures. It supports basic gestures like tap, swipe, pinch, and rotate. AlloyFinger is similar to 'gesto' in terms of simplicity and ease of use, but it is more focused on mobile touch events.
You can set up drag, pinch events in any browser.
$ npm i gesto
<script src="https://daybrush.com/gesto/release/latest/dist/gesto.min.js"></script>
import Gesto from "gesto";
let tx = 0;
let ty = 0;
let scale = 1;
const getso = new Gesto(target, {
container: window,
pinchOutside: true,
}).on("drag", e => {
tx += e.deltaX;
ty += e.deltaY;
target.style.transform = `translate(${tx}px, ${ty}px) scale(${scale})`;
}).on("pinchStart", e => {
e.datas.scale = scale;
}).on("pinch", e => {
scale = e.datas.scale * e.scale;
target.style.transform = `translate(${tx}px, ${ty}px) scale(${scale})`;
});
// remove event
getso.unset();
If you have any questions or requests or want to contribute to gesto
, please write the issue or give me a Pull Request freely.
If you find a bug, please report to us opening a new Issue on GitHub.
This project is MIT licensed.
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
You can set up drag, pinch events in any browser.
The npm package gesto receives a total of 117,097 weekly downloads. As such, gesto popularity was classified as popular.
We found that gesto 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.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.