Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
popmotion
Advanced tools
The JavaScript motion engine. Handles animation, physics, and input tracking.
Popmotion is a functional, reactive JavaScript motion library that allows developers to create animations and handle gestures with ease. It provides a powerful API to animate values, handle user input, and define complex animations using simple building blocks.
Animation
This feature allows you to animate values from a starting point to an end point. The 'onUpdate' function is called with the latest value as the animation progresses.
import { animate } from 'popmotion';
animate({
from: 0,
to: 100,
onUpdate: latest => console.log(latest)
});
Gestures
This feature handles gesture physics, such as momentum and deceleration, allowing for smooth animations that feel natural. The 'modifyTarget' function can adjust the ending value dynamically.
import { inertia } from 'popmotion';
const { stop } = inertia({
from: 0,
velocity: 10,
power: 0.8,
timeConstant: 700,
modifyTarget: target => Math.round(target / 100) * 100,
onComplete: () => console.log('Animation complete')
});
Pose
This feature allows you to create draggable elements that can be thrown and will return to a specified position. It combines multiple functionalities like pointer tracking and spring physics for realistic motion.
import { styler, spring, listen, pointer, value } from 'popmotion';
const ball = document.querySelector('.ball');
const divStyler = styler(ball);
const ballXY = value({ x: 0, y: 0 }, divStyler.set);
listen(ball, 'mousedown touchstart').start((e) => {
e.preventDefault();
pointer(ballXY.get()).start(ballXY);
});
listen(document, 'mouseup touchend').start(() => {
spring({
from: ballXY.get(),
velocity: ballXY.getVelocity(),
to: { x: 0, y: 0 },
stiffness: 200,
damping: 10
}).start(ballXY);
});
Framer Motion is a popular animation library for React. It offers more integrated React component features compared to Popmotion, which is more low-level and functional.
GSAP (GreenSock Animation Platform) is a robust animation library that is often considered the industry standard for web animations. It offers a wider range of animation utilities and effects compared to Popmotion, but it is not as lightweight.
Anime.js is another animation library that provides similar functionalities to Popmotion. It is known for its simple API and lightweight nature, making it a good alternative for those who find Popmotion's functional approach challenging.
Make it pop with animation, physics, and input tracking. In the browser, on Node, anywhere.
Free for personal and non-profit projects. Just $9/month for commercial use!
Download | Subscribe | API | Guides | Twitter
FAQs
The animator's toolbox
The npm package popmotion receives a total of 890,510 weekly downloads. As such, popmotion popularity was classified as popular.
We found that popmotion 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.