
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
animate-css-grid
Advanced tools
This small script wraps a CSS grid (or really, any container element) and animates updates to its children. When the grid container, or one of its immediate children, is updated via the addition or removal of a class, the grid will smoothly transition its children to their new positions and sizes.
Call the wrapGrid
method on your grid container.
The optional config object allows you to control duration, staggering, and easing.
Example options object:
{
// create a stagger effect (default is false)
stagger: true,
// specify a duration in ms (default is 250 ms)
duration: 500
// specify an easing as a string. default is 'Quadratic.InOut'
easing: 'Sinusoidal.InOut'
}
ES6 Module:
yarn add animate-css-grid
import { wrapGrid } from animateCSSGrid
const grid = document.querySelector(".grid");
const { unwrapGrid } = wrapGrid(grid, {duration: 500});
// later, to remove transitions
unwrapGrid()
Or from a script tag:
<script src="https://unpkg.com/animate-css-grid@latest"></script>
<script>
const grid = document.querySelector(".grid");
const { unwrapGrid } = animateCSSGrid.wrapGrid(grid, {stagger: true});
</script>
The script registers a MutationObserver
that activates when the grid or one of its immediate children adds or loses a class.
It uses the FLIP animation technique to smoothly update the grid, applying a counter transform to the children of each item so that they do not appear distorted while the transition occurs.
OK:
<!-- grid style applied via a class -->
<div class="some-grid-class-that-changes">
<!-- a grid item with a single child -->
<div class="grid-item">
<div>
...child 1
...child 2
</div>
</div>
<div>
Not going to work:
<!-- grid styles applied inline -->
<div style="[grid styles that change]">
<!-- a grid item with multiple children -->
<div class="grid-item">
...child 1
...child 2
</div>
<div>
FAQs
Buttery smooth, easy transitions for CSS grid
The npm package animate-css-grid receives a total of 4,581 weekly downloads. As such, animate-css-grid popularity was classified as popular.
We found that animate-css-grid 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.