ded / morpheus

A Brilliant Animator
504 stars 57 forks source link

(webkit/Moz/O/ms)Transform support #11

Closed cjc closed 13 years ago

cjc commented 13 years ago

G'day, I took a stab at adding transform animation support. It ended up adding more code than I expected but it works pretty nicely across rotate/skew/translate/scale in IE9/FF/Webkit/Opera.

Any interest in merging this functionality?

ded commented 13 years ago

Hmmm... I do have interest. I had this idea that I would create a better extension model, but i think this makes most sense. It's all just animations anyway.

I'll have a look thru and possibly change some code styles

ded commented 13 years ago

cool. merged it in a local branch and made some style changes. i'll have to sort out the tests for IE6/8. I added bowser in the meantime since i may just bypass the tests for those browsers.

Thanks again for this wonderful addition to Morpheus!

cheers, Dustin

cjc commented 13 years ago

Awesome, thanks for merging (and for polishing those rough corners).

I realised this morning that I forgot one thing. In the raw morpheus example I set the initial transform before starting the animation with element.style[morpheus.transform];morpheus(element,...);, but when used with ender that property isn't visible.

The simplest solution would be to expose morpheus.transform as a global with the ender wrapper, allowing $(element).css({$.morpheusTransform:'rotate(30deg'}).animate('transform':'rotate(40deg)')

Alternatively, I could add the 'browser specific transform property name' detection to Bonzo to allow $(element).css('transform':'rotate(30deg)').animate('transform':'rotate(40deg)')

Let me know if you have a preference and I'll chuck it in asap.

Cheers, Cameron

ded commented 13 years ago

the 2nd is much, much more prefered and i think Bonzo users would dig it.