Coder Social home page Coder Social logo

mojojs-animation's Introduction

MojoJS-Animation v2.1.0

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,        smooth,
    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 an animation object.
 *
 * @param {String (selector) | Array<HTMLElement> | NodeList | HTMLElement} targets
 */
 MojoJS.createAnimation(targets)


/**
 * Animate with config.
 *
 * the variable params are 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 or helpful for you, maybe buy me a coffee via Sponsor Button.

mojojs-animation's People

Contributors

scottcgi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mojojs-animation's Issues

Can this framework support cubic-bezier functions?

Recently I've been work on some complicate animation in my project, then I learned this great framework. I know it support fully compatible standard easing effect and more. but I was wonder that if we can customized easing effect by the css props 'transition-timing-function',input the cubic-bezier function. It might be helpful for developers to restore the design of the animation.

mojoQuery bug

  1. html: <a id="a" />
    selector:
    a#a => mojoQuery: 0 results
    #a.b => mojoQuery: 1 results
  2. html:<a class="a b c">
    selector:
    .a.b => mojoQuery: 0 results
  3. html:<a class="a b">
    selector:
    .ab => mojoQuery: 1 results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.