SVG – Learning by Coding
1:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
3:
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
4:
<!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
5:
]>
6: 7:
<!-- SVG - Learning by Coding - http://www.datenverdrahten.de/svglbc/ -->
8:
<!-- Author: Dr. Thomas Meinike 12/02 - thomas@handmadecode.de -->
9: 10:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
11: 12:
<title>SVG - Learning by Coding</title>
13:
<desc>SVG-Spezifikation in Beispielen</desc>
14:
<text x="20" y="30" style="fill: #000; font-size: 24px">
15:
Element animateMotion (mpath)</text>
16: 17:
<path d="M 100,100 L 300,50 A 100,100 0 0,1 300,200 Z"
18:
style="fill: none; stroke: #CCC; stroke-width: 1px"/>
19:
<path id="einpfad" d="M 100,250 L 300,250 L 300,350 L 100,350 Z"
20:
style="fill: none; stroke: #CCC; stroke-width: 1px"/>
21: 22:
<!-- ohne mpath -->
23:
<circle cx="0" cy="0" r="5" style="fill: #F00">
24:
<animateMotion begin="0s" dur="5s" repeatDur="indefinite"
25:
path="M 100,100 L 300,50 A 100,100 0 0,1 300,200 Z"/>
26:
</circle>
27: 28:
<!-- mit mpath -->
29:
<rect x="-5" y="-5" width="11" height="11" style="fill: #00C">
30:
<animateMotion begin="0s" dur="10s" rotate="45" repeatDur="indefinite">
31:
<mpath xlink:href="#einpfad"/>
32:
</animateMotion>
33:
</rect>
34: 35:
</svg>
[zum Anfang]