SVG Animations using SMIL (3)
SVG Animations using SMIL (3)
SVG Animations using SMIL (3)
Let's first take a look at a simple animation.
Ball
This is how the code looks like.
<svg width="300px" height="50px" viewBox="0 0 300 50">
<circle cx="15" cy="25" r="15" fill="#d22">
<animate
attributeName="cx"
dur="1.5s"
begin="0s"
values="15;280;15"
repeatCount="indefinite"
fill="freeze"
/>
</circle>
</svg>
So, cx="15" cy="25" is streight forward isn't it?
We can visualize <circle cx="15" cy="25" r="15"> bellow:
Now, what is:
values="15;280;15"
we have for the animation?
This is animation for "cx".
Moving cx from "15" to "280", and then back to "15" at the end.
Moving cx from "15" to "280", and then back to "15" at the end.
Pretty intuitive, isn't it?
NEXT
BACK
Your privacy
By clicking "OK" you agree Astralscience can store cookies on your device and disclose information in accordance with our Cookie Policy.
個人情報の保護について
以下 OK をクリックすることにより、Astralscience があなたの端末にクッキーを保存し、クッキー・ポリシー に従って情報を開示することに同意します。
Quyền riêng tư của bạn
Bằng cách nhấn "OK", bạn đồng ý rằng Astralscience có thể lưu cookie trên thiết bị của bạn và xử lý thông tin theo Chính sách Cookie của chúng tôi.
