ios - CSS Animation transform: translate poor performance on iPad -
ios - CSS Animation transform: translate poor performance on iPad -
i finding hard troubleshoot slow/ janky rendering of transition animation on portfolio site http://robthwaites.com, when viewed in mobile safari/ (ipad , iphone).
when click on 1 of homepage thumbnails, .presentation content appears after transition in big divs translate out (div.workdoor-top , div.workdoor-bottom, each big triangular gray background svg). creates kind of 45degree angle 'wipe' effect.
transition cued jquery .addclass() (adds .hidden class div). transition super-smooth in desktop browser.
i think have followed tips in article, keeping transition transform: translatex only. http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/
i have attempted observe problem might using chrome dev tools timeline, shows lot of recalculate style happening on transition, not sure happening , how might prepare it.
changing svg background image png did nil help performance.
sorry can't more articulate, know if possible (a) target problem chrome dev tools timeline (or in dev tool), , (b) find prepare animate smoothly on mobile device.
full css site here. divs in question transition below.
.workdoor-top { position: absolute; top: 0%; right: 0%; z-index: 30; width: 2000px; height: 2000px; background: url(../portfolio-door-top.svg) top right no-repeat; -webkit-background-size: cover; background-size: cover; pointer-events: none; -webkit-transition: -webkit-transform 0s ease; transition: transform 0s ease; -webkit-transform: translate(0px, 0); -ms-transform: translate(0px, 0); transform: translate(0px, 0); } .workdoor-top.hidden { -webkit-transform: translate(2000px, 0); -ms-transform: translate(2000px, 0); transform: translate(2000px, 0); -webkit-transition: -webkit-transform 1s ease; transition: transform 1s ease; } .workdoor-bottom { position: absolute; bottom: 0; left: 0; z-index: 30; width: 2000px; height: 2000px; background: url(../portfolio-door-bottom.svg) bottom left no-repeat; -webkit-background-size: cover; background-size: cover; pointer-events: none; -webkit-transition: -webkit-transform 1s ease; transition: transform 1s ease; -webkit-transform: translate(-15px, 0); -ms-transform: translate(-15px, 0); transform: translate(-15px, 0); } .workdoor-bottom.hidden { -webkit-transform: translate(-2000px, 0); -ms-transform: translate(-2000px, 0); transform: translate(-2000px, 0); -webkit-transition: -webkit-transform 0s ease; transition: transform 0s ease; }
try adding this:
.workdoor-top, .workdoor-top.hidden, .workdoor-bottom, .workdoor-bottom.hidden { -webkit-transform: translatez(0); }
which should forcefulness device utilize hardware acceleration.
alternatively either of these properties should work:
-webkit-perspective: 1000; -webkit-backface-visibility: hidden;
there's post explaining here: http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/
ios css animation google-chrome-devtools
Comments
Post a Comment