Hacker News new | past | comments | ask | show | jobs | submit | aerotwist's comments login

That's not quite true. Using a CSS transition on left, top, width etc requires a trip to the main thread, so it's no better of worse to do it with CSS than JavaScript. It is bad in both cases and should be avoided.

Equally animating transform and opacity changes with JS or CSS is normally the same. The only time we can do compositor only is when it's something like an infinite animation of something like a transform; that can be done without hitting the main thread. That rarely happens in real life though. Most apps and sites have way more complex anims going on.


I suspect the OP was referring to 'transform: translate3d()' transitions rather than left/top ones, which AFAIK still get a big performance boost.


Yeah, I mean things like this: https://github.com/brutaldesign/swipebox/commit/235a0c1b213b...

(This was my pull request to Swipebox which turned choppy swiping action into almost-native feel. Their latest release seems to have gotten a bit choppy again though, I'll have to investigate the more recent commits later. You can test drive at http://dheera.net/photos/abstract/dancelight using a mobile device).

Google Image Search on mobile also does a good job of achieving almost-native tracking feel.


Yes those do: http://www.html5rocks.com/en/tutorials/speed/high-performanc... I was just clarifying on the remark of JS / jQuery as the cause of poor performance rather than what specifically was animated.


Thank you!


Hope so! :) Feel free to let me know if you have specific questions, and if I can flow them into the podcast I will. I'd rather the episodes actually answered peoples' questions than be based on my hunches as to what's interesting or helpful.


Well, I know it's a premature worry for a beginner, but I'd be interested in the topic of how different (OS, Browser, GraphicsVendor) permutations stack up in terms of performance and compatibility. Are there any particular sweet spots or laggards?


This site is the gold reference: http://webglstats.com


The rendering is still done in CSS, which was the point, as opposed to using Canvas or WebGL. I wasn't trying to do everything in CSS, since that wouldn't actually be possible

I take your point, but however you choose to apply the CSS it's still CSS :)


Since CSS 3D transforms require the GPU you will need either Chrome or Safari running on a computer which supports GPU acceleration. Chrome on Windows XP, for example, does not allow use of the GPU by default so you wouldn't see WebGL or CSS 3D transforms


I'm in Firefox 4 on Windows, which does support WebGL, and all I see is blankness.


It's using CSS 3D transforms not WebGL :)


Simple isn't always bad ;)


It's relying on Modernizr's detection of WebGL, which is the best available. But yes WebGL is not ubiquitous as yet so some folks aren't going to see it.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: