Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
node-touch
Advanced tools
Readme
npm install node-touch
Extra touch events and hover behaviour for touch devices.
require('node-touch')();
<div class="touch">Example</div>
In order to use the features, you have to call the module once in the beginning and create the dom elements with the touch
class.
div { ... }
div.hover { ... }
On touch devices, the hover behaviour is quite crappy. With this module, if you use the .hover
class instead of the :hover
pseudoclass, on a touch device the class will be applied when the element is touched on the screen, and on a non-touch device it will act as :hover
. example.
var button = document.createElement('button').
button.classList.add('touch');
document.body.appendChild(button);
button.addEventListener('tap', function (event) {
console.log('Tapped!');
}, false);
You can use the tap
event just as a normal event. It is sort of the touch equivalent of click
.
var div = document.querySelector('div');
div.addEventListener('touchleave', function (event) {
console.log('Left!');
}, false);
The event fires when the finger left the element.
You can add listeners to swipe events. There are three type of swipe events.
div.addEventListener('swipestart', function (event) {});
div.addEventListener('swipemove', function (event) {});
div.addEventListener('swipeend', function (event) {});
The event
object's important properties are:
RIGHT
, LEFT
, UP
, DOWN
This module sets a global Boolean that just tells you whether the user is on a touch device. It can be useful!
FAQs
Extra touch events and hover behaviour for touch devices.
The npm package node-touch receives a total of 26 weekly downloads. As such, node-touch popularity was classified as not popular.
We found that node-touch 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.