Giter Club home page Giter Club logo

animatic's Introduction

animatic's People

Contributors

dotcypress avatar kof avatar lvivski avatar paulmillr 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  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

animatic's Issues

translateX, translateY, rotateX, rotateY, etc.

I noticed that in the input example (http://lvivski.com/anima/example/keyboard_mixed.html) you have code to make sure that only one axis is affected at a time:

a.translate = translate.map(function(t, i) { return t || a.translate[i] })

It's a functionality that I often need when I'm coding for user interaction. It might be nice if that were built into the library so that a user wouldn't have to do it themselves each time they wanted to affect only a single axis. If there was the option to translate, rotate, scale, etc. for each axis (translateX, scaleY, rotateZ, etc.), it could really help.

Enhancement: animate background color

I currently use move.js but am looking to replace it with anima for its pause/resume functionality. With move.js I can animate the background color of an item using move(element).set('background-color', 'red'). I use this quite a bit in my app. It would be nice if anima supported such a feature.

After animation End event, make item do the same animation, it will repeat old animation again

Hello there,

first sorry my english, but I meet some problem need your help...

UI animation flow:(like Loop)

functionA make animation-a -> click butttonA -> make butttonA do animation-A -> on animation-A end event -> call a functionC

animation-a: make butttonA appear,add end event
animation-A: make butttonA disappear,add end event
functionC: call functionA again

but in actually situation,first time(first Loop), when I click button, it will trigger animation-a end event first,then do animation-A, then trigger animation-A end event.

secend time(second Loop), when I click button, it will trigger animation-a end event twice! then do animation-A twice, then trigger animation-A end event twice...

third time, when I click button, it will trigger animation-a end event triple! then do animation-A triple, then trigger animation-A end event triple... and so on..

I couldn't separate animation in the same item object...I don't know why..

below is my codes:

function showUI2(){
if(scene2_finished){

    scene2_finished = false;

    item3
        .animate({
            opacity:0
        },0)
        .animate({
            translate: [0, -220, 0],
            opacity:0.8
        }, 800, 'ease-in-quat')
        .animate({
            scale: [0.3,0.3, 0]
        }, 500, 'ease-in-out-back');
    backBtn_item
        .animate({
            opacity:0
        },0)
        .animate({
            translate: [0, 30, 0],
            opacity:1
        }, 1300, 'ease-in-quat');

    backBtn.addEventListener('click',function(e){

        backBtn_clickflag = true;
        e.preventDefault();

        item3
            .animate({
                scale: [-.3, -.3, 0],
                translate: [0, 220, 0],
                opacity:0
            }, 600, 'ease-in-out-back');


        backBtn_item
            .animate({
                translate: [0, -30, 0],
                opacity:0
            }, 600, 'ease-in-out-back')

            .on('end', after_end());

    },false);

}

}
function after_end(){
return function () {
if(backBtn_clickflag){
backBtn_clickflag =false;

        showUI2();
    }
}

}

Animation changes CSS

Hello,

First of all, thanks for this amazing tool! I just touch it, there are some questions to ask.

I have read the doc, but does not seem to set CSS. For example, I want to make an element from white to red. If this is the solution?

Thank you!

fade in animation

I want to fade in an element like this:

world.add(elem).animate({
opacity: 0
}, 0).animate({
opacity: 1
}, 2000, 'ease-in-out-quad');

but it does not start with full transparency, what am i doing wrong?

Using `top` instead of `window` to reference requestAnimationFrame, cancelAnimationFrame and performance throws security errors from within an iFrame.

I'm not sure if this is the case for every browser, but this seems to be the case on modern ones. There may be a reason you chose to use top instead of window, but if your script is running within an iFrame, something about this will throw a cross-domain security error, while using window won't.

(Obviously only if the content of the iFrame is on a different domain as the host.)

After animation End event, make item do other animation, it will repeat old animation again

Hello there,

first sorry my english, but I meet some problem need your help...

UI animation flow:(like Loop)

functionA make animation-a -> click butttonA -> make butttonA do animation-A -> on animation-A end event -> call a functionC

animation-a: make butttonA appear,add end event
animation-A: make butttonA disappear,add end event
functionC: call functionA again

but in actually situation,first time(first Loop), when I click button, it will trigger animation-a end event first,then do animation-A, then trigger animation-A end event.

secend time(second Loop), when I click button, it will trigger animation-a end event twice! then do animation-A twice, then trigger animation-A end event twice...

third time, when I click button, it will trigger animation-a end event triple! then do animation-A triple, then trigger animation-A end event triple... and so on..

I couldn't separate animation in the same item object...I don't know why..

below is my codes:

function showUI2(){
if(scene2_finished){

    scene2_finished = false;

    item3
        .animate({
            opacity:0
        },0)
        .animate({
            translate: [0, -220, 0],
            opacity:0.8
        }, 800, 'ease-in-quat')
        .animate({
            scale: [0.3,0.3, 0]
        }, 500, 'ease-in-out-back');
    backBtn_item
        .animate({
            opacity:0
        },0)
        .animate({
            translate: [0, 30, 0],
            opacity:1
        }, 1300, 'ease-in-quat');

    backBtn.addEventListener('click',function(e){

        backBtn_clickflag = true;
        e.preventDefault();

        item3
            .animate({
                scale: [-.3, -.3, 0],
                translate: [0, 220, 0],
                opacity:0
            }, 600, 'ease-in-out-back');


        backBtn_item
            .animate({
                translate: [0, -30, 0],
                opacity:0
            }, 600, 'ease-in-out-back')

            .on('end', after_end());

    },false);

}

}
function after_end(){
return function () {
if(backBtn_clickflag){
backBtn_clickflag =false;

        showUI2();
    }
}

}

anima.js not run in Safari

why my code not run in Safari? in console, syntax_err: DOM exception 12. in FF, it's running well. sorry for my bad english

Animations do not start in ios7

Hi

Just tried your examples on the latest version of ios, both safari and chrome. Nothing happens. No errors. Matrix transformation isn't applied, css transformations do not work too.

Thanks

Stopping anima after it processes animation

Hi Jehor,

So I have this little bit of code. The thing is: no matter where I put world.stop it is being called before animation finishes. setTimeout did not work, animate(..).end didnt work. Do you have a nice way to invoke world.stop after all animations are finished? Any help would be highly appreciated

function animaHandler() {

              //here are all necessary calls and variable definitions

        item[0]
        .animate({
          translate: [-vectorSize, -vectorSize, 0]
        }, {duration:animSpeed,queue:false}, 'ease-out-quart' );

        item[1]
        .animate({
          translate: [vectorSize, -vectorSize, 0]
        }, {duration:animSpeed,queue:false}, 'ease-out-quart' );

        item[2]
        .animate({
          translate: [-vectorSize, vectorSize, 0]
        }, {duration:animSpeed,queue:false}, 'ease-out-quart' );

        item[3]
        .animate({
          translate: [vectorSize, vectorSize, 0]
        }, {duration:animSpeed,queue:false}, 'ease-out-quart');
           world.stop();          

    }

    var onlyone = 0
    $('#some-div').mouseenter(function(){
        if (onlyone == 0){
            animaHandler();
            onlyone=++onlyone
        }
    });

Add toStart() and toEnd() control methods

I'm not sure if this is possible to do reliably given your approach, but GSAP does this nicely. jQuery did something vaguely similar in the new 1.9 branch, adding a finish() method.

Single animations are easy to do, but what happens when they start overlapping? GSAP which has a great timelining features where you can essentially drop a scrubber into the bottom of the browser window for development and control an animation timeline directly with a draggable scrubber, just like a video program! For serious timeline animations, full-featured development controls are a must...

Animate multiples elements of a specific classe?

Hello,

First of all, thank you for this amazing tool! I have been using it, and It is really great.

I was wondering if it is possible to animate multiples elements at once, for instance, to animate all div with the class ".xyz".

I have read the doc, but it seems to only animate a single element, not to apply an animation to multiple elements like it's possible to do in CSS.

Thank you!

Add support for additive animations

Let's say I have an object wiggling from left to right and back in a continuous infinite loop:

myObject.animate({  
    translate : [10,0,0],  // to the right
    duration: 500
}).animate({  
    translate : [-10,0,0],  // back to origin
    duration: 500
}).infinite();

and then later, responding to some event, I want to move the whole object a defined distance to the right, without the left-right wiggle ever stopping:

myButton.onclick = function() {
  myObject.animate({  
      translate : [100,0,0],  // to the right
      duration: 2000
  });
};

This doesn't work right now:

http://jsfiddle.net/N2v6H/

Instead, the ball goes careening off the screen. Re-expressing the wiggle in parallel at the time of the second call doesn't fix things, either:

ball.stop().animate([{  
   translate : [100,0,0],  // to the right
   duration: 1000
},{ 
    translate : [10,0,0],  // to the right
    duration: 250
},{  
    translate : [-10,0,0],  // back to origin
    duration: 250
}]);

http://jsfiddle.net/N2v6H/1/
(This is also throwing an error because the stop method isn't chainable as it stands, another issue.)

I think it's pretty clear that the existing behavior isn't useful in any real world context. My sense is that the cleanest solution might be to add an argument to the animate function, specifying whether it adds to existing animations or overwrites them.

Anima not working on Opera

Hello. I've got Opera 12.14 on Windows 7.
I'm using your library for animate translation and anima works very well, but I got some toubles on Opera. Below you can see errors from error console:

Uncaught exception: TypeError: '_requestAnimationFrame' is not a function
Error thrown at line 743, column 4 in () in http://....../js/anima.js.xhtml:
this.frame = _requestAnimationFrame(update);
called from line 737, column 4 in World() in http://....../js/anima.js.xhtml:
this.init();
called from line 5, column 4 in () in http://....../js/anima.js.xhtml:
return new World();
called from line 1046, column 4 in http://....../map.xhtml?windowId=6be:
var world = anima.world();

Animation events trigger at the beginning of the animation (should be triggered at the end)

See example. When clicking on the heart icon, it should bounce first, and then change the color to red. But strangely it triggers to red at the very beginning before the animation's finish. Where am I doing it wrong?

function swapIcon(icon){
    icon.css("color", "red");
}

$(document).ready(function() {
   $('a.icons.love').click(function(e){
        e.preventDefault(); 
        $(this).anima().animate({ 
            name: 'bounce',
            duration: 1100
        }).on('end', swapIcon($(this)));
    }); 
});

Raf shim

We need a way to use external shims. Currently requestAnimationFrame reference is locally defined. I would recommend you to use https://github.com/kof/animation-frame or at least to provide a way to overwrite raf reference anima uses.

documentation issues

Whoa, this is cool. The "matrix" demo is sweet! Having just completed a pretty complex animation sequence in pure Raphael (which has some painful limitations) the support for "parallel" animation is very appreciated. I want to fool around some more, but here are some initial thoughts. I've broken them into separate issues for ease of reference.

First, about the docs:

  1. How about some clarification in the docs on why to choose js versus css worlds, other than client support?

  2. How about a browser support chart?

  3. Why don't you use semicolons in your demonstration code? I don't mean to start a debate here, but it really helps make your code accessible, especially to beginners. (At the very least, it's necessary for minification.)

  4. A few typos:

"transformations’ values are relative to the last known Item state, it’s initial state..."

should be

"transformations’ values are relative to the last known Item state, its initial state..." (no apostrophe)

"You can call .infinite() at the end of you .animate’s chain,"

should be

"You can call .infinite() at the end of .animate’s chain,"

Ability to call css-defined animations (compatibility with animate.css)

I actually prefer to write animations in css sometimes so it would be handy to be able to use this library to call them. This would allow for a seamless integration with other libraries such as animate.css or magic.

An example of this functionality can be found in move.js with .animate(..) which I'm currently using but would like to potentially switch over to this one in the future.

Apologies if this feature already exists but I couldn't find any documentation on it.

Really neat library btw, looking forward to exploring it a little bit further.

Thanks

CSS animations are broken when the first stylesheet in the page has a @charset declaration

CSS.prototype.style tries to insert a keyframe rule at the begining of the first stylesheet. That doesn't work in Chrome (Version 33.0.1750.152 to 36.0.1924.0 canary at least) if the stylesheet has a @charset (fails also with @import) rule at the very begining (no blank space before). It triggers an HierarchyRequestError with the message "Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to insert the rule."

The quick fix is to insert the new keyframes rule at the end of the stylesheet (or at least not at the 0 index) like: this.stylesheet.insertRule(this.keyframes(animation), this.stylesheet.rules.length);

IE 10 and Firefox support

I tested in IE 10 and Firefox (Aurora) and none of the examples work. Only managed to view them in Chrome.

New Animation - change width and height

Hello. I just want to simply animate div resize (height and width).
Can you add this to your briliant library? I really like your library smooth animations, just missing this one feature.

Timeline

Hi,

I just downloaded the latest version of plugin and observed that width, height and opacity are not working in timeline. Request you to solve the same Thanks in advance

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.