New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Progress Monitoring #16
Comments
Hey Justin! This is a really good question. Providing support for this feature would not inherently have a negative performance impact. However, it would undoubtedly lead to severe performance drawbacks being triggered by users' own callback functions. If, for example, they were to use the wrong jQuery call inside their callback -- one that queries the DOM -- it would introduce layout thrashing into the requestAnimationFrame tick. So while I do not discount the utility of progress monitoring, I would be hesitant to provide support for it. |
Thanks for the response. Your concern is valid, but there's only so much a library can do to protect developers from themselves anyway, right? In my case the lack of this callback is stopping me from using velocity as a drop in in-lieu of 'animate' (although I can't remember if you've explicitly marketed velocity as a direct drop-in). |
Justin, May I ask for the use case you're dealing with in which you must monitor progress? I don't doubt there are good ones -- but the more I hear of them, the more I'm likely to integrate this soon. |
@julianshapiro I have a circle that gradually fills with a color, as it's filling I would like a visual counter to increment. |
Hmm. I can't think of a simple way to do that outside of Velocity. OK. I agree this is seriously worth considering. Thank you sincerely. |
In relation to this and #32 I'd suggest looking at the progress callback (in Promises). From what I can see from the above it would probably be a nice integration point. |
@julianshapiro I'm creating an interactive card flip that needs to have the animation taken over when the user lets go (during the drag the y-rotation is set using the position of the mouse/finger). Anyway, I'm animating these two divs that are on top of one another and when they cross over the 50% mark they need to have their z-indices swapped. I suppose I could do this with some clever z-index manipulating (as in, animate the z-index property such that when the rotation is at the 50% mark they swap over), so I might take that route for now, but this would make my life so much easier. Also, just to note, Transit.js doesn't support this either so, one more leg up if Velocity were to implement this. |
Thanks a bunch for the example, @mattegan. Now that the Velocity UI pack is done and released (took me a very long time to do it properly), I'm getting back to the remaining feature requests and processing whichever don't lead to bloat. Progress monitoring is at the top of my list and will be implemented this week. |
@julianshapiro No problem! Thanks for the sweet library. |
I'm trying to come up with the best implementation for this:
The goal of the API, as with the Sequences API (http://VelocityJS.org/#sequences), is to not force the user to have to calculate too much progress data on their own in their callbacks (Velocity should do a good chunk of it). |
Hope this helps! |
Thanks for this, Matt. Great write-up. I'm going to focus on the progress feature for now. Expect it to be implemented very shortly. I agree; I'll copy jQuery for the base values then extend from there. |
This has been implemented. See VelocityJS.org/#progress in about 1 hour. |
Hey Julian, just wanted to say thanks! |
Thank YOU for taking the time to help out. Super appreciated, Matt. Hit me up in the future if you have other recommendations. |
It'd be great to have support for an animation progress callback (like jQuery animate) ... or would this have a severe negative impact on performance?
The text was updated successfully, but these errors were encountered: