Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stagas/animatrix

Create DOM Animations.
https://github.com/stagas/animatrix

Last synced: 13 days ago
JSON representation

Create DOM Animations.

Awesome Lists containing this project

README

        


animatrix

Create DOM Animations.



npm i animatrix

pnpm add animatrix

yarn add animatrix

## API

# AnimSettings

# Easing

    [ number, number, number, number ]

# KeyframeAnimation

} # KeyframeAnimationDetails } # ManualAnimation

    {


    # current

    # from # last # set

      # (values)

        # values


        (values)  =>



# state # stop

    # (values)

      # values


      (values)  =>



# to # update

    # (values)

      # values


      (values)  =>



} # ManualAnimationState

    "preparing" | "running" | "finished"

# StepAnimation

    {


    # current

    # from # set

      # (values)

        # values


        (values)  =>



# state # t

    number

# to # update

    # (values)

      # values


      (values)  =>



} # StepAnimationState

    "preparing" | "running" | "finished"

# Easing # BezierEasing(mX1, mY1, mX2, mY2)

    # mX1


      any

    # mY1

      any

    # mX2

      any

    # mY2

      any


    BezierEasing(mX1, mY1, mX2, mY2)  =>



      # (x)

        # x


          any


        (x)  =>


          any

# createKeyframeAnimation(animSettings, target, getKeyframes, current)

    # animSettings

    # target

      HTMLElement | SVGElement

    # getKeyframes()


      getKeyframes()  =>



        Keyframe []

# current

createKeyframeAnimation(animSettings, target, getKeyframes, current)  =>

# createManualAnimation(anim) # createStepAnimation(AnimSettings, anim)

## Credits
- [event-toolkit](https://npmjs.org/package/event-toolkit) by [stagas](https://github.com/stagas) – Toolkit for DOM events.
- [is-mobile-agent](https://npmjs.org/package/is-mobile-agent) by [stagas](https://github.com/stagas) – Singleton boolean that is true when user agent is mobile or tablet.

## Contributing

[Fork](https://github.com/stagas/animatrix/fork) or [edit](https://github.dev/stagas/animatrix) and submit a PR.

All contributions are welcome!

## License

MIT © 2022 [stagas](https://github.com/stagas)