I do projects that require smooth transitions and animations. We recently switched from using Javascript animation to CSS in almost 100% of cases.
I found that using translate3d provides very nice animations on both the mobile and the desktop.
My current animation style is as follows:
CSS
.animation-up{ transform: translate3d(0, -100%, 0); } .animation-down{ transform: translate3d(0, 100%, 0); } .animation-left{ tranform: translate3d(-100%, 0, 0); } .animation-right{ tranform: translate3d(-100%, 0, 0); }
Recently, I began to study different structures that seem to be buzzing a lot. Two in a specific GreenSock ( http://greensock.com/tweenmax ) and Famo.us ( http://famo.us ). Both show amazing frame rates and amazing performance.
I notice that they use martix conversion.
Greensock example (using matrix):
<div class="box green" style="transform: matrix(1, 0, 0, 1, 0, 100);"></div>
Famo.us example (using a 3D matrix):
<div class="famous-surface" style="transform-origin: 0% 0% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 149, 385, 0, 1);"></div>
My question is ... What is the difference between translate3d and matrix? Is there a significant improvement using the matrix over translate3D? Is there any other method that gives even better results?
I was pleased with translate3D, but I want to know which method will give the best animations and is looking for guidance on what might be.