
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.
motion-sensitive
Advanced tools
The plugin MotionSensitive create an instance which allows to follow the movements of an element and to deduce a possible direction.
npm i motion-sensitive
or
yarn add motion-sensitive
import MotionSensitive from "motion-sensitive";
usage motion-sensitive plugin
const motion = MotionSensitive();
const btn = document.querySelector("#btn1");
const { x, y, width, height } = btn.getBoundingClientRect();
const point1 = { x, y: y + height };
const point2 = { x: x + width, y: y };
document.body.addEventListener("mousemove", (e) => {
const mouseX = e.pageX - document.body.offsetLeft;
const mouseY = e.pageY - document.body.offsetTop;
motion.trackPoint({
x: mouseX,
y: mouseY
});
});
function spy() {
if (motion.isLookedIn(point1, point2)) {
btn.classList.add("wakeup");
} else {
btn.classList.remove("wakeup");
}
requestAnimationFrame(spy);
}
spy();
| argument | type | default | Description |
|---|---|---|---|
gat | Number | 5 | angle gap between target and current direction |
sensibility | Number | 1 | average of the n last direction |
const motion = MotionSensitive({
gap: 10,
sesibility: 10
});
| argument | type | Description |
|---|---|---|
obj | Object | target coordinates {x,y} |
| return | Description |
|---|---|
boolean | true when the tracked positions indicate that they are going towards the target else false |
motion.isLookedAt({ x: 1, y: 2 }); // true or false
| argument | type | Description |
|---|---|---|
obj1 | Object | target coordinates {x,y} |
obj2 | Object | target coordinates {x,y} |
| return | Description |
|---|---|
boolean | true when the tracked positions indicate that they are going towards between this targets else false |
motion.isLookedIn({ x: 1, y: 2 }, { x: 1, y: 1 }); // true or false
FAQs
Lorem ipsum sit amet
We found that motion-sensitive 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.