Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
A JavaScript library for animating elements between states
Based on animation code of SortableJS
Install:
$ npm install --save animatum
Import:
import Animatum from 'animatum';
import Animatum from 'animatum';
let container = document.getElementById('container');
let animatum = new Animatum(container);
// Save the "before state"
animatum.captureAllStates();
// Reverse the order of the elements
container.append(...Array.from(container.childNodes).reverse());
// Animate from the "before state" to the new state
animatum.animateAll();
new Animatum(container: HTMLElement[]|HTMLElement, options: Object): Animatum
To use Animatum you must first create an instance of Animatum on the container(s) whose children you want to animate. An optional options
object object may also be passed to set the global options.
animatum.captureAllStates(options: Object)
Used to capture the animation states of all the children of the container(s).
This should be done immediatly before the DOM change that you want to animate takes place.
An optional options
object object may be passed to overwrite the global options.
animatum.animateAll(options: Object)
Used to animate from the captured animation states of all the children in the container(s) to their new state.
This should be done after the DOM changes you want to animate have taken place.
An optional options
object object may be passed to overwrite the global options.
animatum.addState(state: AnimationState)
Used to add a custom animation state to the captured animation states.
If there is an already a state captured for the element, this added state will overwrite it.
Refer to the AnimationState definition.
animatum.removeState(element: HTMLElement)
Used to remove an animation state of the specified element from the captured animation states.
duration {Number}
The duration, in milliseconds, of the animation. Default: 150
easing {String}
A string specifying the easing that should be applied to the animation.
See easings.net for examples. Default: "ease"
ignore {Function|String}
Function or CSS selector of element(s) that should be ignored during this action or all actions.
If set to a function, the first argument will be the element, and returning true
will make the element be ignored.
Default: function() { return false; }
An AnimationState is an object specification that Animatum uses to track the captured animation states of elements.
In order to add an animation state using the addState
method, the object you pass in must contain the following properties.
element {HTMLElement}
The element that this state is for
rect {DOMRect}
The DOMRect (or object with DOMRect properties) of the element, that will serve as the captured position of the element.
FAQs
A JavaScript library for animating elements between states
We found that animatum 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.