daniel-lundin / snabbt.js

Fast animations with javascript and CSS transforms
http://daniel-lundin.github.io/snabbt.js/
MIT License
5.2k stars 330 forks source link

allDone and complete is not fired with duration: 0 #71

Closed korywka closed 8 years ago

korywka commented 8 years ago

I am trying to set starting position with duration: 0, but callbacks are not fired. Is it just me?

daniel-lundin commented 8 years ago

Hi,

Sorry for the delay, I've been busy with moving to ES6. It's probably a bug I will have a look at it as soon as I can..

korywka commented 8 years ago

By the way, I used snabbt for animations here: http://macpaw.com/cleanmydrive (screen width > 1200px) and applications webview tutorials. The only inconvenience is too much callbacks (http://cdn.macpaw.com/media/7983b6b695c001b3dcb00cf036c762b4/js/cleanmydrive/cleanmydrive.js) =) snabbt is cool, thanks!

daniel-lundin commented 8 years ago

Wow, very nice work! Very cool to see snabbt put to good use :) The complete-callback issue with duration: 0 should be fixed in the latest release.

Also, I've been thinking about this callback-problems, so I've added sequencing in latest release as well. So instead of using callbacks you can specify an array of animations that will run in sequence:

snabbt.sequence([
    [elementTwo, {
      position: [100, 0, 0],
    }],
    [elementOne, {
      position: [100, 0, 0],
    }],
    [elementOne, {
      position: [0, 0, 0],
    }],
    [elementTwo, {
      position: [0, 0, 0],
    }],
  ]
);

It's still a bit of an experiment, so please let me know what you think.

jeanpaze commented 8 years ago

This sequencing is awesome! Very nice improvement.

korywka commented 8 years ago

Will try next time, thx!

I was thinking about something like .done() method, to chain sequences :)