Robot and Backgrounds

Animating inline svg

I animated the inline svg using classes defined in the svg itself. There are two of them, a translateX and a colour change called 'blushing'. The result is that both the translateX and the blushing class work.

When the svg is inline like this we also have the option of having a style section in the html which uses the id of an svg element to set its style. Also, javascript in the html page can do the same thing. The robot's legs are coloured in using these two techniques, the purple one using a style and the green one using javascript.

robot Layer 1
A very useful part of being able to control the svg drawing is that we can have buttons to start and stop the animation. This is easy to do using inline svg. To do it using the img tag you would have to create buttons in the svg which did the same thing. There is an example of doing this here: Moving the Origin.