Alright, so I've put together a comprehensive presentation on the basics of CSS Animations and a bit about SVG.
Here are the simplified key points:
- The CSS Animation spec primarily allows you to define "key frames" or transitions between different styles.
- Within CSS3, "Transform" permits adjustments in scale, rotation, skew, and position offset of an element on a webpage.
- You can smoothly transition between styles by specifying the duration and timing function, even utilizing cubic bezier for more control.
- By combining animations, transitions, and transforms, you can easily move and transform any page element (image, div, video, etc.) with graceful degradation for older browsers.
However, every element is essentially treated as an undifferentiated 2D rectangle during animation, focusing more on animating sprites. Sencha previously had a CSS Animation tool built around this concept, though it's now discontinued. Make sure to explore the demos for inspiration on leveraging CSS primitives effectively.
For SVG Animation, options include using the built-in SVG animation features, SMIL (similar to CSS Animations), and JavaScript, offering richer capabilities compared to CSS Animation as it involves manipulating SVG Objects' properties. Notably, SVG animation excels in flexibly defining drawing paths and fills, enabling intricate animations like a walking cat achieved through line animations not feasible with CSS alone.
While SVG provides robust flexibility, creating animations can be cumbersome due to verbose XML formatting. For easier implementation, consider tools like Raphael for JavaScript users, which also gracefully degrades to VML for older versions of IE. Keep in mind that some browsers may lack full support for SVG, particularly regarding animated properties.
Update: contemporary animation libraries such as snap.svg are now available, enhancing animation possibilities.
In contrast, Android 2.x lacks SVG support, making CSS Animations preferable for web animations on mobile devices.
Having delved into SVG animation myself to develop the introductory presentation shared earlier, I must say hand-coding SVG animations can be challenging due to complexity, non-intuitiveness, and debugging difficulties arising from its XML nature.