paper-motion

Magic move

magic-move

Each part of A flies on its own spring into the matching part of B; text cross-blurs; the box reshapes.

Install
$ npx paper-motion add magic-move

Copies the code to moves/ in your project, yours to edit.

Tune it, then add it to your kit
0.0s
Parameters
duration
stagger
stiffness
damping
import { magicMove } from './moves/magic-move.js';

// in s.update(t)
magicMove(a, b, p);
Defaults

Notes

  • Magic move: parts with the same data-part in A and B fly from A's place and size to B's, each on its own spring, a few frames apart; text parts scale evenly and cross-blur; parts only in A leave, parts only in B pop in. The box behind (background, border, corners) reshapes from A's to B's.
  • Stack A and B in one positioned slot (their parent); give the slot overflow:hidden to keep travel inside it.
  • Pass the real duration in seconds and call it through p = 1: that is when it hides the layers it made.
  • Render with --motion-blur 5.
  • Parts match by data-part (label, title, body, meta, media…); unmatched parts leave or pop in.

Spec

Id
magic-move
Type
Component transitions
Version
1.0.0
Engine
>=0.2.0
License
MIT

Related