HTML SVG Scale Rotate move Animation

                          Rajeev Tiwari


(1)  <!DOCTYPE html>
<html>
<body>

<p><strong>Note:</strong> This example does not work in Internet Explorer and Safari.</p>

<svg width="500" height="500">
  <g transform="translate(100,100)">
    <text id="TextElement" x="0" y="0" style="font-family:Verdana;font-size:24"> It's SVG!
      <animateMotion path="M 0 0 L 100 100" dur="5s" fill="freeze" />
    </text>
  </g>
  Sorry, your browser does not support inline SVG.  
</svg>

</body>
</html>


(2)  <!DOCTYPE html>
<html>
<body>

<p><strong>Note:</strong> This example does not work in Internet Explorer and Safari.</p>

<svg width="600" height="600">
  <g transform="translate(100,100)"> 
    <text id="TextElement" x="0" y="0" style="font-family:Verdana;font-size:24; visibility:hidden"> It's SVG!
      <set attributeName="visibility" attributeType="CSS" to="visible" begin="1s" dur="5s" fill="freeze" />
      <animateMotion path="M 0 0 L 100 100" begin="1s" dur="5s" fill="freeze" />
      <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="-30" to="0" begin="1s" dur="5s" fill="freeze" /> 
      <animateTransform attributeName="transform" attributeType="XML" type="scale" from="1" to="3" additive="sum" begin="1s" dur="5s" fill="freeze" /> 
    </text> 
  </g> 
  Sorry, your browser does not support inline SVG.
</svg>
</body>
</html>



(3). <!DOCTYPE html>
<html>
<body>

<p><strong>Note:</strong> This example does not work in Internet Explorer and Safari.</p>

<svg width="600" height="600">
  <rect id="rec" x="300" y="100" width="300" height="100" style="fill:lime"> 
    <animate attributeName="x" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="300" to="0" /> 
    <animate attributeName="y" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="100" to="0" /> 
    <animate attributeName="width" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="300" to="800" /> 
    <animate attributeName="height" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="100" to="300" /> 
    <animate attributeName="fill" attributeType="CSS" from="lime" to="red" begin="2s" dur="4s" fill="freeze" />
  </rect>
  <g transform="translate(100,100)"> 
    <text id="TextElement" x="0" y="0" style="font-family:Verdana;font-size:24; visibility:hidden"> It's SVG!
      <set attributeName="visibility" attributeType="CSS" to="visible" begin="1s" dur="5s" fill="freeze" />
      <animateMotion path="M 0 0 L 100 100" begin="1s" dur="5s" fill="freeze" />


(4). <!DOCTYPE html>
<html>
<body>

<p><strong>Note:</strong> This example does not work in Internet Explorer and Safari.</p>

<svg width="100%" height="300px">
<g id="R1" transform="translate(250 250)"> 
  <ellipse rx="100" ry="0" opacity=".3">
  <animateTransform attributeName="transform" type="rotate" dur="7s" from="0" to="360" repeatCount="indefinite" />
  <animate attributeName="cx" dur="8s" values="-20; 220; -20" repeatCount="indefinite" />
  <animate attributeName="ry" dur="3s" values="10; 60; 10" repeatCount="indefinite" />
  </ellipse>
</g>
<use xlink:href="#R1" transform="rotate(72 390 150)" />
<use xlink:href="#R1" transform="rotate(144 390 150)" />
<use xlink:href="#R1" transform="rotate(216 390 150)" />
<use xlink:href="#R1" transform="rotate(288 390 150)" />
</svg>

</body>
</html>

मैं इस ब्लॉग का संस्थापक और एक पेशेवर ब्लॉगर हूं। यहाँ पर मैं नियमित रूप से अपने पाठकों के लिए उपयोगी और मददगार जानकारी शेयर करता हूं। 
Written by Rajeev Tiwari

Comments

Popular posts from this blog

URL क्या है

Java Data type

Java introduction