General techniques for animating SVG
This section will introduce various general techniques for animating SVG. While there are different tools available to do this work (you'll meet two later on in this chapter), it's useful to know how these things are done without the aid of frameworks or libraries. This section will provide that foundation.Â
You've already previously seen some of these techniques, but it's good to look at them again, solely in the context of animation.Â
Animating with pure JavaScript
Before there were CSS keyframe animations and CSS transitions, two techniques we'll look at later in this chapter, we had to produce all of our animations and interesting effects in the browser by hand using JavaScript; updating properties in a loop and optimizing frame rates manually. Eventually, libraries such as jQuery came along and removed the need to know how this worked, by presenting animations as part of their API. Thankfully, these days, in addition to the animation methods available...