Reputation: 1
I am learning svg animation and I have problems with scaling. Examples are very complicated and contain javascript. I want to make a smoke animation. A flat circle going from up to down with a scaling effect (from scale(1) to scale(0.5). But when I use this code the animation goes up, not down and doesn't work. Help?
<p data-height="265" data-theme-id="0" data-slug-hash="KeGXOa" data-default-tab="html,result" data-user="VoltarZord" data-embed-version="2" data-pen-title="SmokeDown" class="codepen">See the Pen <a href="https://codepen.io/VoltarZord/pen/KeGXOa/">SmokeDown</a> by Voltar Zord (<a href="https://codepen.io/VoltarZord">@VoltarZord</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
Upvotes: 0
Views: 2643
Reputation: 4595
You probably should have a look at some documentation about SVG (ie: https://developer.mozilla.org/en-US/docs/Web/SVG). SVG can be animated with SMIL Animation (https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_animation_with_SMIL) but it's deprecated. You can animate SVG with many options, CSS is one of them.
What you can do for your issue would be this:
@keyframes smoke {
100% {
transform: translate(0px, 50px) scale(0.5);
}
}
Here's the codepen: https://codepen.io/anon/pen/wXYyzZ
Upvotes: 1
Reputation: 14375
Assuming I got you right, you have 2 issues:
transform
entries, they should be united.So, change your 100% entry to:
100% {
transform: translate(0px, 50px) scale(0.5);
}
and things will work find.
Upvotes: 0