#jd17de
Sauna, Audiobooks and Barcelona
Please use inline for the best Browser Support and Animation
<svg viewBox="0 0 213.79 211.49">
<title>Shapes</title>
<rect class="rect" width="213.79" height="211.49"/>
<circle class="circle" cx="50" cy="50" r="80">
<line x1="0" y1="0" x2="200" y2="200">
<ellipse cx="200" cy="80" rx="100" ry="50">
<polygone points="100,20 250,190 190,210">
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180">
</svg>
<svg viewBox="0 0 213.79 211.49">
<title>Attribute</title>
<foreignobject x="20" y="10" width="180" height="150">
<body>
<h2>My Foreign Object</h2>
<p>Enjoy your JoomlaDay</p>
</body>
</foreignobject>
<circle cx="300" cy="200" r="100" fill="#dfac20"/>
<text x="0" y="15" fill="red">I love SVG!</text>
<foreignobject x="230" y="120" width="180" height="180">
<h2>Title</h2>
<ol>
<li>Cat</li>
<li>Squirrel</li>
<li>Dog</li>
</ol>
</foreignobject>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 149.44 39.78"><defs><style>.cls-1{fill:#676767;}.cls-2{fill:#f39200;}</style></defs><title>logo_neu_20161016</title>
<g class="mygroup">
<path class="cls-1" d="M44.38,34.66c0,4.88-2.35,8.84-5.24,8.84H20.31c-2.89,0-5.24-4-5.24-8.84V17.22c0-4.88,2.35-8.84,5.24-8.84H39.14c2.9,0,5.24,4,5.24,8.84Z" transform="translate(0 -3.72)"/>
<path class="cls-2" d="M6.92,0h24.9a6.93,6.93,0,0,1,6.93,6.93V20.59a6.93,6.93,0,0,1-6.93,6.93H6.93A6.93,6.93,0,0,1,0,20.59V6.92A6.92,6.92,0,0,1,6.92,0Z"/>
<path class="cls-1" d="M52.4,23h0a3,3,0,0,1,2.47-1.45,3,3,0,0,1,2.69,1.65,3.36,3.36,0,0,1,2.87-1.65c2.45,0,3.08,1.91,3.08,4v5.57H61.75V25.84c0-1.19-.16-2.73-1.73-2.73-1.91,0-2,2-2,3.42v4.58H56.18V26.18c0-1.21-.06-3.06-1.71-3.06-1.91,0-2.07,2-2.07,3.42v4.58H50.61V21.8H52.4Z" transform="translate(0 -3.72)"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 149.44 39.78">
<path class="cls-1" d="M44.38,34.66c0,4.88-2.35,8.84-5.24,8.84
H20.31c-2.89,0-5.24-4-5.24-8.84V17.22c0-4.88,2.35-8.84,5.24-8.84
H39.14c2.9,0,5.24,4,5.24,8.84Z" transform="translate(0 -3.72)"/>
</svg>
Path is more complex,
use a SVG-Editor
Commands to draw
Commands to draw Example
small letter relative values, big letter absolute values
<svg viewBox="0 0 149.44 39.78"><defs><style>.cls-1{fill:#676767;}.cls-2{fill:#f39200;}</style></defs><title>logo_neu_20161016</title>
<g class="mygroup">
<path class="cls-1" d="M44.38,34.66c0,4.88-2.35,8.84-5.24,8.84H20.31c-2.89,0-5.24-4-5.24-8.84V17.22c0-4.88,2.35-8.84,5.24-8.84H39.14c2.9,0,5.24,4,5.24,8.84Z" transform="translate(0 -3.72)"/>
<path class="cls-2" d="M6.92,0h24.9a6.93,6.93,0,0,1,6.93,6.93V20.59a6.93,6.93,0,0,1-6.93,6.93H6.93A6.93,6.93,0,0,1,0,20.59V6.92A6.92,6.92,0,0,1,6.92,0Z"/>
<path class="cls-1" d="M52.4,23h0a3,3,0,0,1,2.47-1.45,3,3,0,0,1,2.69,1.65,3.36,3.36,0,0,1,2.87-1.65c2.45,0,3.08,1.91,3.08,4v5.57H61.75V25.84c0-1.19-.16-2.73-1.73-2.73-1.91,0-2,2-2,3.42v4.58H56.18V26.18c0-1.21-.06-3.06-1.71-3.06-1.91,0-2.07,2-2.07,3.42v4.58H50.61V21.8H52.4Z" transform="translate(0 -3.72)"/>
</g>
</svg>
hidden
visible
playing with the view box
Illustrator CC create small and clean SVG's with Export.
Menu -> Edit -> Export as
Choose SVG in the Dropdown Menu
Compare the different tools for yourselve.
<?php echo file_get_contents("images/my-logo.svg"); ?>
<svg version="1.1" class="symbolnone" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" xml:space="preserve">
<symbol id="usemylogo">
<path class="wpmdruck1" d="M75.14,56.51a31.55,31.55,0,0,1,.44-10.7c1.17-5.18,6.07-7.62,8.3-8.51a26.33,26.33,0,0,0- 6.13-.78,25.52,25.52,0,0,0-3.83.29A25.24,25.24,0,0,0,59.32,79a22.18,22.18,0,0,1,4.27- 12.26C66.44,62.64,71,59.6,75.14,56.51Z" transform="translate(-52.53 -36.52)"></path>
<path class="wpmdruck2" d="M68.81,85.51" transform="translate(-52.53 -36.52)"></path>
</symbol>
</svg>
<svg viewBox="0 0 285 54.83">
<use xlink:href="#usemylogo"></use>
</svg>
html
css
.smbolnone {
display: none;
}
give your Groups and Path classes and id's
<svg>
<g class="group">
<rect class="rect" width="21.21" height="211.49"/>
<path class="path" ..../> />
</g>
<path class="path" ..../> />
</svg>
pick the group or the rect, circle directly
can be looks different in all browsers
for example rotate
will not longer supported
TweenLite, TweenMax
Stagger
draw an SVG
MorphSVG
drag SVG
Motion along the Path
Tweenlite, Tweenmax
TweenStagger
Relative HSL Color Animation
MorphSVG
from #id to #id
TweenLite.to("#start, 1, {morphSVG:"#drop"});
convert the Path
MorphSVGPlugin.convertToPath("circle, rect,
ellipse, line, polygon, polyline");
MorphSVG
MorphSVG
var tl = new TimelineMax({repeat:-1, repeatDelay:1, delay:3});
tl.to("#star", 1.5, {
morphSVG: "#bolt",
transformOrigin: "center center",
scale: 1
}).to("#star", 1.5, {
morphSVG: "#cloud",
transformOrigin: "center center",
scale: 1,
fill:"#ADD8E6"
}).to("#star", 1.5, {
morphSVG: "#rain",
transformOrigin: "center center",
scale: 1,
fill: "#4169E1"
}).to("#star", 1.5, {
morphSVG: "#star",
transformOrigin: "center center",
scale: 1,
fill:"#FFA500"
});
MorphSVG
a Pen by Sarah Drasner
give your SVG's a stroke
then animate it
TweenMax.staggerFrom(".draw-svg", 2, {drawSVG:0}, 0.1);
Pen by Chris Gannon
Pen by Sarah Drasner
easy to create an SVG in D3
and make charts
Text
Robert Mittl
@mittlmedien
mittl-medien.de