Mario 3 recreated with CSS3 animations and media queries
developer.mozilla.org
developer.mozilla.org
The resize thing is a cool hack. I wonder if anyone has ever made a game with window resizing as the control mechanism.
Finally, if you do you want to get rid of the resizing, maybe an easy way would be to simulate it by covering the un-animated part of the window with a curtain (Mario style: http://www.flickr.com/photos/shieldsokc/5388817583/).
Good idea re the curtain - it would be quite an easy port to make the animation work like that, so think I might do that at some point.
Think there are lots of possibilities around window resizing that haven't been explored yet - could make some really interesting effects...
Challenge accepted!
Perhaps I'm missing the point, but it would have been better in my opinion if you'd found another way to make it auto play in whatever window size.
Thanks for the feedback though - might create a separate self-running version at some point.
That said, I get that you're pushing the limits as it is here and you've likely already considered this as an option.
Not sure if an increasing div would work. Could potentially do it as an iframe, but not sure how nicely that'd work, would have to try it out.
Think I'll release it as a separate full animation at some point - will write up how it's all put together when I do.
I have tabs, so I had to pull the tab out to a new window (or else risk resizing everything that is already the way I want it).
I don't know how wide my windows are! I had to pull up the javascript console and read "window.innerWidth" and 320 is amazingly small for me.
Reason for the resizing down at the start is simply so only certain parts of the animation show at different times. It means I can control what width the animation is being viewed at, as otherwise I'd have to animate everything across a very large width potentially, which would be pretty time consuming, as this could be huge. Think with the feedback I've had, will release as a non media query animation as well when I get chance.
There's nothing ground-breaking here, but neither is there in many of the XKCD stunts that we fawn over here. I think if you just describe it that way we'd all know what's going on.
?
[I guess I went so ridiculous it actually sounds cool.]
SVG would probably be much more robust as a solution (as would canvas have been) - I think the demo shows more than anything that CSS3 animations need slightly more reliable support across modern browsers before they are a viable choice for doing some really nice things with them.
In Firefox, it works as you would expect, stepping through the spriting. In webkit, it's very inconsistent in how it renders, and doesn't look as polished because of this.
I've noticed the speed of the animation being effected by the resizing - like mentioned to others, will probably release a version which just shows the animations off separate to the window resizing as well to avoid this. The main reason for including reliance on media queries was to fit it into the mozilla dev derby criteria for this month.
I could pretty easily modify and release as a straight up animation though with no media query control.
I'm going to add a width counter to give more feedback on the resizing, as seems to be a bit of a bottleneck.
I should investigate CSS3 animations further.