Nightly Punk Masters

    svg-morpher
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.7 • Public • Published

    SVG-Morpher

    About

    This is a helper module for morphing between SVGs. Specifically, between two SVGs with different amount of Path elements.

    Usage

    1. Import it as a module:
    import SVGMorpher from "svg-morpher";
    
    1. 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.

    1. Have Fun!

    Dependencies

    This module uses two dependencies:

    1. Flubber - SVG Interpolator -> for the interpolation between SVG Paths

    2. Just.animate - library for animation. In this case, Timeline is used for animation.

    Author @nfejzic - Nadir Fejzic

    Install

    npm i svg-morpher

    DownloadsWeekly Downloads

    0

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    10.2 kB

    Total Files

    4

    Last publish

    Collaborators

    • nfejzic