svg-morpher
v1.0.7
Published
Module used for morphing SVG into another SVG, specifically to SVG with different amount of Path tags. It does so with the help of Flubber and just.animate libraries.
Downloads
277
Maintainers
Readme
SVG-Morpher
About
This is a helper module for morphing between SVGs. Specifically, between two SVGs with different amount of Path elements.
Usage
- Import it as a module:
import SVGMorpher from "svg-morpher";
- Use either morphFromTo or morphFromContainerToSvg function. First three parameters must be provided, callback is optional!
SVGMorpher.morphFromContainerToSvg(containerID, toSVG, duration, callback);
// or
SVGMorpher.morphFromTo(fromSVG, toSVG, duration, callback);
Note - the morph function provides callback function with a boolean parameter -> true when animation ends.
- Have Fun!
Dependencies
This module uses two dependencies:
Flubber - SVG Interpolator -> for the interpolation between SVG Paths
Just.animate - library for animation. In this case, Timeline is used for animation.
Author @nfejzic - Nadir Fejzic