SVG – Learning by Coding

[ keySplines.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: 
    <style type="text/css">

18: 
      <![CDATA[

​19: 20: 
      .gelb

21: 
      {

22: 
        fill#FF0;

23: 
      }

​24: 25: 
      .rot

26: 
      {

27: 
        fill#F00;

28: 
      }

​29: 30: 
      .gruen

31: 
      {

32: 
        fill#090;

33: 
      }

​34: 35: 
      .blau

36: 
      {

37: 
        fill#00C;

38: 
      }

​39: 40: 
      line

41: 
      {

42: 
        stroke#000;

43: 
        stroke-width2px;

44: 
      }

​45: 46: 
      ]]>

47: 
    </style>

​48: 49: 
  </defs>

​50: 51: 
  <text x="20" y="30" style="fill: #000; font-size: 24px">

52: 
    Animationen mit Key-Splines</text>

​53: 54: 
  <circle class="gelb" cx="100" cy="350" r="20">

55: 
    <animate attributeName="cy" attributeType="XML" begin="0s" dur="10s"

56: 
      calcMode="spline" values="350;80" keyTimes="0;1" keySplines="0.9 0.1 0.1 0.9"

57: 
      repeatCount="5" fill="freeze"/>

58: 
  </circle>

​59: 60: 
  <circle class="rot" cx="150" cy="350" r="20">

61: 
    <animate attributeName="cy" attributeType="XML" begin="0s" dur="10s"

62: 
      calcMode="spline" values="350;80" keyTimes="0;1" keySplines="0.1 0.6 0.5 0.8"

63: 
      repeatCount="5" fill="freeze"/>

64: 
  </circle>

​65: 66: 
  <circle class="gruen" cx="200" cy="350" r="20">

67: 
    <animate attributeName="cy" attributeType="XML" begin="0s" dur="10s"

68: 
      calcMode="spline" values="350;80" keyTimes="0;1" keySplines="0.0 1.0 1.0 0.0"

69: 
      repeatCount="5" fill="freeze"/>

70: 
  </circle>

​71: 72: 
  <circle class="blau" cx="250" cy="350" r="20">

73: 
    <animate attributeName="cy" attributeType="XML" begin="0s" dur="10s"

74: 
      calcMode="spline" values="350;80" keyTimes="0;1" keySplines="0.0 0.5 0.0 1.0"

75: 
      repeatCount="5" fill="freeze"/>

76: 
  </circle>

​77: 78: 
  <line x1="70" y1="60" x2="280" y2="60"/>

79: 
  <line x1="70" y1="370" x2="280" y2="370"/>

​80: 81: 
  <!-- alt (fehlerhaft): http://www.averagejackal.net/keysplinetool.html -->

82: 
  <a xlink:href="http://www.carto.net/svg/samples/keysplines.svg" target="_top">

83: 
    <text x="20" y="410">

84: 
      "Key Splines graph tool" &#8211; Hilfsmittel zur Berechnung der Parameter

85: 
   </text>

86: 
   <set attributeName="fill" attributeType="CSS" to="#F00" begin="mouseover"/>

87: 
   <set attributeName="fill" attributeType="CSS" to="#000" begin="mouseout"/>

88: 
  </a>

​89: 90: 
</svg>

[zum Anfang]