File: gears.svg

package info (click to toggle)
batik 1.19-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 28,976 kB
  • sloc: java: 192,236; xml: 19,457; javascript: 1,276; sh: 85; makefile: 5
file content (76 lines) | stat: -rw-r--r-- 3,247 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<!--

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

-->
<?xml-stylesheet type="text/css" href="extension.css" ?>

<svg id="body" width="450" height="500" viewBox="0 0 450 500"
     xmlns="http://www.w3.org/2000/svg" 
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns:batik="http://xml.apache.org/batik/ext">

   <script type="text/ecmascript">
      <![CDATA[
        var  g1 = document.getElementById("g1");
        var  g2 = document.getElementById("g2");
        var  g3 = document.getElementById("g3");
        var  g4 = document.getElementById("g4");
        var  rot = 0;
        function rotate() {
          rot += 2;
          if (rot > 720) rot-=720;
          g1.setAttributeNS(null, "transform", "rotate("+(rot*1)+")");
          g2.setAttributeNS(null, "transform", "rotate("+(-rot/2)+")");
          g3.setAttributeNS(null, "transform", "rotate("+(-rot*2)+")");
          g4.setAttributeNS(null, "transform", "rotate("+rot/2+")");
          setTimeout("rotate()", 30);
        }
      ]]>
   </script>

   <title>Animated Stars</title>
   <g id="body" onload="rotate()" >
      <text class="title" x="50%" y="40">Animation on a Custom Element</text>
      <g transform="translate(40, 100)">
               <g transform="translate(100, 100)" >
                  <batik:star id="g1" fill="crimson" r="50" ir="40" sides="24"/>
               </g>
               <g transform="translate(230, 100), rotate(3.75)">
                  <g id="g2">
                     <batik:star fill="gold" r="90" ir="80" sides="48"/>
                     <batik:star fill="crimson" r="50" ir="40" sides="24"/>
               <text fill="gold" text-anchor="middle">Batik Rules!</text>
             </g>
               </g>
               <g transform="translate(100, 165), rotate(15)">
                  <batik:star id="g3" fill="gold" r="25" ir="15" sides="12"/>
               </g>
               <g transform="translate(230, 190) rotate(3.75)">
                  <batik:star id="g4" fill="green" r="50" ir="40" sides="24"/>
               </g>
      </g>
   </g>

    <!-- ============================================================= -->
    <!-- Batik sample mark                                             -->
    <!-- ============================================================= -->
    <use xlink:href="../batikLogo.svg#Batik_Tag_Box" />
</svg>