Searching Open Sourcery

Type to search Open Sourcery.

Motion & Scroll

Morph Engine

A spring-driven blob morphs from one element rect and style to another. Interrupt it mid-flight and it reverses.

v0.4.2@magic-spells/morph-engine

$ npm i @magic-spells/morph-engine

GitHubnpmSee it on the showcase →

Live demo

Click a box to see it in action.

Open a tile: it morphs into its detail view, and back into the same tile on close.

About

~11 KB gzipped

Usage

import { MorphEngine } from '@magic-spells/morph-engine';

const morph = new MorphEngine();

// panel grows out of the card
await morph.show({ from: cardElement, to: panelElement });

// panel shrinks back into the card (re-measures both — scroll-safe)
await morph.hide();

About, features, usage and options are taken from the package README.