SVG loading animation - can I combine <use>and <def> and <animate>? -
i have svg-based loading animation, aka "spinning weasel" i'm wondering if can code more efficiently utilizing base animation (the fading out attributes) , referencing in <use>
tags?
<defs> <line id="bit" x1="50" y1="25" x2="50" y2="10" stroke="#000000"> </line> </defs> <g> <use xlink:href="#bit" opacity="0.8" transform="rotate(0 50 50)"> <animate attributename="opacity" values="1;0.2" dur="2.4s" repeatcount="indefinite" begin="0.0s" /> </use> </g>
there 12 of these <use>
tags, omitted them here brevity. in animation tag, only begin
attribute changes each time, rest identical.
i tried various approaches seemed reasonable me, none work, i'm hoping svg guru here can point me in right direction. or forced repeat animation attributes on each of tags?
knowing little svg, realize there many ways accomplish same result.
thanks.
--> fiddle
i don't think can trying because begin
attribute of animation elements , not property can inherited use.
depending on mean "more efficient", there other ways achieve similar effect. example, can use scripting:
this smaller file, animation not smooth because rotating spinner, rather animating opacity.
Comments
Post a Comment