Curious how I did the animated “gifs” on the Sven Bømwøllen > a half-assed review post? Well, wonder no more.
The HTML is a simple div with a class
|
|
|
|
The important things here are:
- div’s
width
andheight
: how big the frame is? background-image
: the image that we’ll use for the animationsteps(6)
: how many steps (frames) does the image have?- animation duration: i used
0.6s
. Actually it’s 0.1 per frame, so the animation looks very similar to the one in the game. background-position
: we start from0 0
(top left), and we end the animation at0 -448px
, meaning that the end frame will be 448 pixels below the origin. This can be tweaked if you need to alter the animation a bit, but it’s usually the height of the image.
This allowed me to turn this image
into this animation: