Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
},
"bugs": "https://github.com/aholachek/animate-css-grid/issues",
"devDependencies": {
"@parcel/packager-ts": "2.8.3",
"@parcel/transformer-typescript-types": "^2.8.3",
"@parcel/packager-ts": "^2.15.4",
"@parcel/transformer-typescript-types": "^2.15.4",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"parcel": "^2.8.3",
"typescript": "4.9.5"
"parcel": "^2.15.4",
"typescript": "^5.8.3"
},
"dependencies": {
"@popmotion/easing": "^1.0.2",
"@types/lodash.throttle": "^4.1.7",
"@types/lodash.throttle": "^4.1.9",
"framesync": "^6.1.2",
"lodash.throttle": "^4.1.1",
"popmotion": "^8.7.6"
"popmotion": "^11.0.5"
}
}
17 changes: 9 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@popmotion/easing';
import sync from 'framesync';
import throttle from 'lodash.throttle';
import { tween } from 'popmotion';
import { animate } from 'popmotion';
import {
BoundingClientRect,
CachedPositionData,
Expand Down Expand Up @@ -296,18 +296,19 @@ export const wrapGrid = (
applyCoordTransform(el, coords, { immediate: true });
// now start the animation
const startAnimation = () => {
const { stop } = tween({
const { stop } = animate({
from: coords,
to: { translateX: 0, translateY: 0, scaleX: 1, scaleY: 1 },
to: {
translateX: 0, translateY: 0, scaleX: 1, scaleY: 1,
},
duration,
ease: popmotionEasing[easing],
}).start({
update: (transforms: Coords) => {
applyCoordTransform(el, transforms);
onUpdate: (transforms: Coords) => {
applyCoordTransform(el, transforms)
// this helps prevent layout thrashing
sync.postRender(() => recordPositions([el]));
sync.postRender(() => recordPositions([el]))
},
complete: cachedResolve,
onComplete: cachedResolve,
});
itemPosition.stopTween = stop;
};
Expand Down
Loading