MojoJS-Animation

A lightweight and powerful javascript Animation engine.

Github星跟蹤圖

MojoJS-Animation

MojoJS-Animation is a very lightweight and powerful javascript Animation engine.

It also has very simple, beautiful, easy-to-understand source code and "Make-You-Happy" API.

The Online Demo shows the effect and code usage.

License

MojoJS-Animation is licensed under the MIT License.

Features

  • Support CSS and Transform properties animation.
  • Support queue and concurrent animation.
  • Support a group of elements animation.
  • Support delay animation.
  • Support complete callback on animate (not on element).
  • Support configurable chained complete callbacks.
  • Support fully compatible standard easing effect and more.
    linear
    quadraticIn,   quadraticOut,   quadraticInOut
    cubicIn,       cubicOut,       cubicInOut
    quarticIn,     quarticOut,     quarticInOut
    quinticIn,     quinticOut,     quinticInOut
    exponentialIn, exponentialOut, exponentialInOut
    sineIn,        sineOut,        sineInOut
    circularIn,    circularOut,    circularInOut
    elasticIn,     elasticOut,     elasticInOut
    backIn,        backOut,        backInOut,  backInExponentialOut, backInElasticOut
    bounceIn,      bounceOut,      bounceInOut,
    

Code Structure

MojoJS-Animation Code Structure

How to use

/**
 * Create animation object.
 *
 * @param {String (selector), Array<HTMLElement>, NodeList, HTMLElement} targets
 */
 MojoJS.createAnimation(targets)
 
 
/**
 * Animate with config.
 *
 * the variable params is optional and no order limit, they can be:
 * 
 * duration (Number)  : animation time.
 * isQueue  (Boolean) : inqueue or concurrent.                       
 * complete (Function): complete callback.                       
 * args     (Array)   : complete function args.
 * easing   (String)  : easing function name.
 * config   (Object)  : variable params in object and three more settings:
 *   {
 *       id       (String) : the animation id.
 *       appendTo (String) : callback when animation of this id is completed.
 *       delay    (Number) : delay time before animation starts.
 *   }  
 * 
 * @param  {Object} animStyle 
 * @return {Object} animation
 */
 animation.animate(animStyle[, duration, isQueue, complete, args, easing, config]);


/**
 * The animation complete callback function.
 *
 * args    (Array)     : apply from [config.args].
 * thisArg (Animation) : apply from current animation.
 */
 function completeCallback([arg0, arg1, ...]);

Support

If the source code is useful for you, maybe you could buy me a coffee via Paypal-0.99 :coffee:

主要指標

概覽
名稱與所有者scottcgi/MojoJS-Animation
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-10-10 14:36:40
推送於2021-08-18 09:09:48
最后一次提交2021-08-18 17:09:48
發布數7
最新版本名稱v2.1.0 (發布於 )
第一版名稱mojoFx.js-v1.2.0 (發布於 )
用户参与
星數264
關注者數5
派生數10
提交數73
已啟用問題?
問題數3
打開的問題數0
拉請求數0
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?