Scalable vector graphics (SVG) are a great way to reduce your page load times and have scalable images for all devices and screen resolutions. But that’s not all - you can even manipulate your SVGs any way you choose with JavaScript, just as you can manipulate your web page’s DOM. This opens up a world of creative possibilities. A great tool to leverage these possibilities is the JavaScript library snap.svg.
Patrick Hund, web developer at mobile.de, demonstrates how to do this with some live coding examples.
4. Why Should I Care?
•
Scalable - no more different versions for responsive
web design and retina
•
Light-weight files (use compression for complex
files)
•
SVG markup can be manipulated for animation and
user interaction
5. What About Browser Compatibility?
http://caniuse.com/svg
Source: caniuse.com
6. Fallbacks
Modernizr is your friend!
http://modernizr.com/
Source:
modernizr.com
Source (German):
http://blog.kulturbanause.de/2013/09/svg-mit-png-fallback/
7. Now for the fun part!
aeljs.com
Source: raph
Source: snap
sv
g.io
+,
afari 3.0+, Chrome 5.0
S
supports Firefox 3.0+,
+ and Internet Explore
Opera 9.5
r 6.0+
Dmitry Baranovskiy
@DmitryBaranovsk
apsvg.io
ource: sn
S
Source: dmitry.baranovskiy.com
Source: Wikipedia
(+) so much cooler!
(-) early version (0.3)
(-) sparse code examples in docu
8. Thank You!
GitHub: github.com/pahund
Twitter: @wiekatz
Blog: technology.ebay.de
Email: pahund@team.mobile.de
Special thanks to Martina Freundorfer for a great pairing
session to prepare this talk - Twitter: @heartbeaz