Skip to content

Latest commit

 

History

History
executable file
·
68 lines (46 loc) · 3.46 KB

CHANGELOG.md

File metadata and controls

executable file
·
68 lines (46 loc) · 3.46 KB

Change Log

2.0.0 (2022-11-12)

Version 2 🎉

In this release comes a complete TypeScript rewrite, more efficient engine, simplified codebase & documentation and a few new features.

BREAKING CHANGES

  • Codebase: The codebase has been re-written in TypeScript and all main functions have been turned into classes.

  • MotionProps: The following keys have been removed:

    • ele - This value is can be stored outside of the Motion class
    • stop - This value is now controlled entirely by the Motion class
    • playCount - Is now built into the Motion class
    • reverseAfter - This has been dropped in favour of manually toggling the reverse key of the animation instance using .then(), or using the LoopType.ALTERNATE feature of the loop key
  • Motion: The following features have been removed from the Motion class (formally function):

    • .delay - Animations don't play immediately when they are initiated any more and can now be started using the .play() method
    • .stop - This value was poorly implemented to begin with, and has now been turned into a method which will reset an animation to its original state
    • .eleBase, .eleBaseUpdate, .resetRect() - These 3 were used when the animation needed to deal with the .getBoundingClientRect() API, however if needed they can just be stored outside the Motion object
    • .toggleReverse() - This can be done by just toggling the .reverse value
    • .reset() - See new .stop() method
  • MotionChain: The following features have been removed from the MotionChain class:

    • .playReverse() - This is now an optional boolean that can be passed into the .play() method

NEW FEATURES

MotionProps:

  • state [Optional] - Added state object variable for custom persistent data
    • Example, initialize an animation once, but then dynamically change the element that it plays on
  • loop [Optional] - Loop has changed from taking a boolean to now taking a LoopType enum which has 3 options:
    • NONE - Default
    • LOOP - Loops the animation
    • ALTERNATE - Loops and transitions to the opposite position after each run instead of always starting at the beginning.

Motion:

  • static .preform(props: MotionProps) - A factory builder function for instant initialisation and playback
  • .stop() - Will stop the animation and return it to its original state
  • .pause() - Can be called to pause an animation in its current position. Calling .play() again would then resume the animation from its current state
  • .rewind() - Will rewind the animation from its current position back to the beginning
  • .reset() - By default, will call the first frame of the animation. However it can be set as a lambda on initialisation
  • Getters for some instance values:
    • .id - The instance ID
    • .isPaused - If the instance is paused
    • .stopped - If the instance has stopped (automatically or manually)

MotionChain:

  • .play() - Now has an optional boolean parameter which will play the chain in reverse
  • .togglePause() - Will pause and resume whatever animation in the chain is currently playing

Bug Fixes

  • Engine: Fixed a bug where if you had multiple animations running and one of them finished, the animation that was registered immediately after the one that finished would skip 1 frame.
  • Motion: Fixed a bug where you could trigger and animation start while it was already running causing some interesting results

1.0.0 (2020-09-09)

  • Initial Release