jeremyckahn / shifty

The fastest TypeScript animation engine on the web
https://jeremyckahn.github.io/shifty/doc/
MIT License
1.54k stars 88 forks source link

Added attachment #43

Closed ghost closed 9 years ago

ghost commented 9 years ago

Added the much-needed attachment configuration option. Now you can attach something to a Tweenable instance (e.g.: a DOM element, an object, a string, etc.) and it will be passed to start/step/finish methods as a second parameter. This is very useful. A simple example would be to attach DOM elements (and thus, caching them) to Tweenable instances, so, in the "step" method, you can manipulate/update the attached element's properties according to current state. (of course, more efficient update-batching mechanics would benefit improved performance, but that's another story, Shifty is just a tweening engine, it does not "know" of the DOM and the environment - and it's great!). Demo available in "attachment-demo.html".

jeremyckahn commented 9 years ago

Thanks for this Pull Request! This definitely seems like a handy feature to have. I've made a few inline notes, please address them and I will merge this in.

attachment-demo.html looks really slick! I will link it up in index.html along with the other documentation updates I am working on for #42.

ghost commented 9 years ago

Done. Will make a new pull request in the next minutes with the updates and an updated/more polished and performance optimized demo file. Keep up the good work.

jeremyckahn commented 9 years ago

Thanks, you too! There's no need to make a new Pull Request, you can just push more commits to your master branch and this Pull Request will be updated. Doing so will also allow us to track progress on this patch more easily.

jeremyckahn commented 9 years ago

Just one more tiny tweak. I have to get to work now, but I will do a final pass review and then merge and release this later today. Thanks again!

ghost commented 9 years ago

Done. Good job. Take care.

jeremyckahn commented 9 years ago

Merged and released. Thanks a bunch, this is great! I'm glad you're getting a lot of use out of Shifty.