SVG – Learning by Coding

[ filter_animation.svg --> Grafik anzeigen ]

 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: <!--    AuthorDrThomas Meinike 03/03 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: 
15:   <defs>
16: 
17:     <filter id="filtermix" x="-30%" y="-30%" width="160%" height="160%">
18: 
19:       <feFlood result="out1" style="flood-color: #FFF; flood-opacity: 0.5">
20:         <animate attributeName="flood-color" attributeType="CSS" from="#FFF" to="#00C"
21:           dur="30s" repeatCount="indefinite"/>
22:         <animate attributeName="flood-opacity" attributeType="CSS" from="0.5" to="1.0"
23:           dur="30s" repeatCount="indefinite"/>
24:        </feFlood>
25: 
26:       <feMorphology radius="30" in="SourceAlpha" result="out2" operator="dilate"/>
27: 
28:       <feGaussianBlur in="out2" result="out3" stdDeviation="5">
29:         <animate attributeName="stdDeviation" attributeType="XML" from="5" to="25"
30:           dur="30s" repeatCount="indefinite"/>
31:       </feGaussianBlur>
32: 
33:       <feComposite operator="in" in="out1" in2="out3" result="out4"/>
34: 
35:       <feComposite in="SourceGraphic" in2="out4" operator="over"/>
36: 
37:     </filter>
38: 
39:   </defs>
40: 
41:   <text x="20" y="30" style="fill: #000; font-size: 24px">
42:     Animierte Filterkomposition</text>
43: 
44:   <circle cx="165" cy="130" r="40" style="fill: #FFF; filter: url(#filtermix)">
45:     <animate attributeName="fill" attributeType="CSS" from="#FFF" to="#FF0"
46:       dur="30s" repeatCount="indefinite"/>
47:   </circle>
48: 
49: </svg>

[zum Anfang]