Hacker News new | ask | show | jobs
by beeglebug 4734 days ago
I like the end result, but i'm not sure why they decided to use 14 canvas tags when 1 would have worked just as well.

It seems wasteful, canvas was designed specifically to allow drawing and manipulating multiple images on a single surface, these guys are using canvas as if it were a div with a background image.

2 comments

Maybe they found it performed better, like Adrian Holovaty found for soundslide: http://www.holovaty.com/writing/in-defense-of-canvas/ (see "stacking canvases")
Stacking canvases makes sense when you have ones that either only need to be built on startup or change infrequently. If everything in your animation is moving (like this one) then there’s no performance benefit.
Are you sure about that? Would be interesting to see a performance comparison.
…which makes me wonder if CSS animation on stacked divs would be more efficient too?
...or an animated GIF
If you layer several animations with varying and carefully selected run times over each other, the result never exactly repeats itself. Good luck recreating that with one GIF animation :D
An animated GIF would weigh a lot more.