| 1 |
<?xml version="1.0" 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 |
|
| 5 |
<!-- |
| 6 |
|
| 7 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 |
contributor license agreements. See the NOTICE file distributed with |
| 9 |
this work for additional information regarding copyright ownership. |
| 10 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 |
(the "License"); you may not use this file except in compliance with |
| 12 |
the License. You may obtain a copy of the License at |
| 13 |
|
| 14 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 15 |
|
| 16 |
Unless required by applicable law or agreed to in writing, software |
| 17 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 18 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 |
See the License for the specific language governing permissions and |
| 20 |
limitations under the License. |
| 21 |
|
| 22 |
--> |
| 23 |
<?xml-stylesheet type="text/css" href="extension.css" ?> |
| 24 |
|
| 25 |
<svg id="body" width="450" height="500" viewBox="0 0 450 500" |
| 26 |
xmlns="http://www.w3.org/2000/svg" |
| 27 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 28 |
xmlns:batik="http://xml.apache.org/batik/ext"> |
| 29 |
|
| 30 |
<script type="text/ecmascript"> |
| 31 |
<![CDATA[ |
| 32 |
var g1 = document.getElementById("g1"); |
| 33 |
var g2 = document.getElementById("g2"); |
| 34 |
var g3 = document.getElementById("g3"); |
| 35 |
var g4 = document.getElementById("g4"); |
| 36 |
var rot = 0; |
| 37 |
function rotate() { |
| 38 |
rot += 2; |
| 39 |
if (rot > 720) rot-=720; |
| 40 |
g1.setAttributeNS(null, "transform", "rotate("+(rot*1)+")"); |
| 41 |
g2.setAttributeNS(null, "transform", "rotate("+(-rot/2)+")"); |
| 42 |
g3.setAttributeNS(null, "transform", "rotate("+(-rot*2)+")"); |
| 43 |
g4.setAttributeNS(null, "transform", "rotate("+rot/2+")"); |
| 44 |
setTimeout("rotate()", 30); |
| 45 |
} |
| 46 |
]]> |
| 47 |
</script> |
| 48 |
|
| 49 |
<title>Animated Stars</title> |
| 50 |
<g id="body" onload="rotate()" > |
| 51 |
<text class="title" x="50%" y="40">Animation on a Custom Element</text> |
| 52 |
<g transform="translate(40, 100)"> |
| 53 |
<g transform="translate(100, 100)" > |
| 54 |
<batik:star id="g1" fill="crimson" r="50" ir="40" sides="24"/> |
| 55 |
</g> |
| 56 |
<g transform="translate(230, 100), rotate(3.75)"> |
| 57 |
<g id="g2"> |
| 58 |
<batik:star fill="gold" r="90" ir="80" sides="48"/> |
| 59 |
<batik:star fill="crimson" r="50" ir="40" sides="24"/> |
| 60 |
<text fill="gold" text-anchor="middle">Batik Rules!</text> |
| 61 |
</g> |
| 62 |
</g> |
| 63 |
<g transform="translate(100, 165), rotate(15)"> |
| 64 |
<batik:star id="g3" fill="gold" r="25" ir="15" sides="12"/> |
| 65 |
</g> |
| 66 |
<g transform="translate(230, 190) rotate(3.75)"> |
| 67 |
<batik:star id="g4" fill="green" r="50" ir="40" sides="24"/> |
| 68 |
</g> |
| 69 |
</g> |
| 70 |
</g> |
| 71 |
|
| 72 |
<!-- ============================================================= --> |
| 73 |
<!-- Batik sample mark --> |
| 74 |
<!-- ============================================================= --> |
| 75 |
<use xlink:href="../batikLogo.svg#Batik_Tag_Box" /> |
| 76 |
</svg> |