3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger

3 horizontal lines, burger
Remove all
LOADING ...

Content



    How to Animate SVG with SMIL: A Comprehensive Tutorial

    Clock
    23.01.2026
    /
    Clock
    23.01.2026
    /
    Clock
    14 minutes
    An eye
    395
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0

    Introduction and brief review of SMIL animations, pros and cons

    This article is the only tutorial to create animations for SVG images on SMIL which you will need to create cool and animated previews and icons for your site. For this tutorial, I created a special tool - Animation Editor on SMIL for SVG images which will allow you to practice various techniques and skills in creating animations.
    SVG(Scalable Vector Graphic) is one of the image formats that is described by mathematical formulas and functions, allowing to scale images as big as you with without loosing quality
    SMIL(Synchronized Multimedia Integration Language) - a special markup language created for writing animations for SVG images and more.
    I decided to write this article because I think I can do better and more clearly than the existing analogues on the Internet. And also because, I won’t be able to remember everything about this topic and most likely I will forget some things and techniques, but I also don’t want to constantly rummage through the documentation and jump from head to head.
    Therefore, this guide will be divided into chapters, and the deeper the more difficult. That is, if you just started, then it is best to start with the first chapter (or from the second, if you consider this chapter as the first). Well, if you are already an animator, then it is better to navigate the problem that you encountered and start reading from the corresponding chapter.
    In fact, why should you use SMIL Animations instead of CSS or JS? This approach has many advantages and only two disadvantages. Here are the main benefits:
    1. Easy embedding. That is, you do not need to add additional files or dependencies. Just edit the existing or used SVG image and you're done.
    2. Flexibility. Only in this language can very complex animations be described, where even JS or CSS cannot
    3. Morphing forms of paths of animation. More on this in the corresponding chapter, but in short, it makes it very easy to let the element go on any, even to the most winding, path.
    4. Built-in animation synchronization functionality.
    5. It's just faster, because everything, the animated image itself and the animation code in one file.
    6. Wide browser support. although not complete, so Opera and IE do not support SVG animations at all. But according to statisticshttps://caniuse.com/?search=smil, most users will be able to appreciate your work
    SMIL browser support statistics
    Now let's talk about the disadvantages:
    1. This is a rather difficult language for creating animations. it will take time to hone the skill in using it
    2. Not full support. Yes, I wrote it down to both pluses and minuses. Because for me, if I see 96% support among custom browsers, then it's good. But for burnt web developers, this may not be enough and they need full support from all existing browsers.

    Animation elements

    1. animate - for normal animations
    2. set - just sets the value for the specified element
    3. animateMotion - to move and transform the element. More about this element in this chapter.
    4. animateTransform - to change the geometry of the element - shift, stretch, rotate, scale. More about this in this chapter
    In general, there is still such an element of animation as animateColor. But I didn’t include it here, because it is not very widely supported, and in general, it is recommended to always use animate instead of animateColor.
    And there are only two ways to place these elements in image:
    1. inside the target element, without reference to it
    2. outside the target element, using a link to it by hrefattribute.
    In the first case, we have any animation element in the object to which we want to apply the animation, for example:
    <g id="20" fill="#f00"> <set attributeName="fill" to="#fff"></set> </g>
    That is, we will set the white color to all elements in the group with id="20". Obviously, for relatively simple images, this method is more than acceptable. But as soon as the number of elements exceeds a hundred and more, you will need to somehow organize your code.
    To do this, you can place all the animation elements in one place, where you can edit and group them. You just need to specify the id in the href attribute. For example:
    <g id="20" fill="#f00"> ... </g> ... <set href="#20" attributeName="fill" to="#fff"></set>
    Another important note, in XML in general, and in SVG/SMIL in particular, the letter case is important in contrast to HTML. Therefore, attributeName is not equal to AttributeName. Be careful.
    My tool using the second method. It puts all the animations in one place, and the user only needs to specify the id of the elements required for the animation.

    Simple animations

    Let's start with the simplest animations. Animations of movement of objects on the canvas.
    <animate href="#rect1" attributeName="x" to="50" dur="1s" repeatCount="indefinite"> </animate>
    In the code example above, I used the minimum required attributes for the animation:
    1. href - this is the reference to the object we want to animate
    2. attributeName - what attribute we want to animate
    3. to - what value should this object be brought to at the end of the animation?
    4. dur - how long should this animation work?
    5. repeatCount - this property is optional, but I wanted you, my reader, to definitely see the working animation. The value of this attribute is indefinite, says that the animation will be repeated endlessly.
    You can play around with the movement more. After all, you can specify where to start (from) and how much to change this value (by).
    Using an attribute by you will not get a torn result or jumps of values, as it may seem. That is, it will not be such that first the object X was 0 then, became 100, then another 200 at by = 100. The by attribute indicates how to quickly change the position of the object from dt.
    <animate href="#rect1" attributeName="x" from="-400" to="1920" dur="2s" repeatCount="indefinite"> </animate>
    This is how you can create the effect of an infinite movement of an object. It is also important to understand that using the attribute from, in the beginning of the animation, the object will be placed there without interpolation, that is, instantly, which may not be desirable for some animations.

    Even simpler animations

    Except for the element animate, you can also use set. It is very easy to use and does not animate at all, but only sets values for the target object. Here is a good example:
    <set id="first" href="#rect1" attributeName="x" to="0" begin="0s;last.end" dur="0.5s" fill="freeze" /> <set id="second" href="#rect1" attributeName="x" to="1500" begin="first.end" dur="0.5s" fill="freeze" /> <set id="third" href="#rect1" attributeName="y" to="700" begin="second.end" dur="0.5s" fill="freeze" /> <set id="forth" href="#rect1" attributeName="x" to="0" begin="third.end" dur="0.5s" fill="freeze" /> <set id="last" href="#rect1" attributeName="y" to="0" begin="forth.end" dur="0.1s" fill="freeze">
    In this example, so that the animation works all the time, I didn't use temporary values, but instead of their event ending with the previous animation (in this case, not animations, but setting a value that occurs instantly). These events will be discussed in more detail in this chapter.

    Move objects

    In the previous chapter, we tried moving objects using the general animation element - animate, and the normal value setter - set. And since the object movement is the most common type of animation, SMIL introduced a separate animation element for moving objects - animateMotion.
    Here's how to use it:
    <set href="#rect1" attributeName="x" to="0" begin="0" fill="freeze" /> <set href="#rect1" attributeName="y" to="0" begin="0" fill="freeze" /> <animateMotion id="top" href="#rect1" to="1600,0" dur="1s" begin="0s;left.end" fill="freeze" additive="sum"/> <animateMotion id="right" href="#rect1" from="0,0" to="0,700" dur="1s" begin="top.end" fill="freeze" additive="sum"/> <animateMotion id="bottom" href="#rect1" from="0,0" to="-1600,0" dur="1s" begin="right.end" fill="freeze" additive="sum"/> <animateMotion id="left" href="#rect1" from="0,0" to="0,-700" dur="1s" begin="bottom.end" fill="freeze" additive="sum"/>
    First, I set the initial point to start the animation using set. After I created four movement animations from left to right, from top to bottom, right to left, from bottom to top. Combined all these animations using the ending events of each animation and most importantly, used new attributes such as fill and additive.
    Attribute fill - Sets the behavior to change the final state of the animated attributes. So without fill="freeze" attribute values X and Y will not change and return to the state before the animation begins.
    Attribute additive - Allows you to summarize the result of the previous animation with its current change.
    It's all cool, but in fact animateMotion invented with a bias of use along with the attribute path. When used in such way you can easily animate the path of an object along a given path. For example, like this:
    <set href="#rect1" attributeName="x" to="0" begin="0" fill="freeze" /> <set href="#rect1" attributeName="y" to="0" begin="0" fill="freeze" /> <animateMotion id="top" href="#rect1" path="m 127.42,211.29 c 54.84,-8.6 109.68,-17.2 164.52,-25.81 238.18,-31.18 476.34,-62.37 714.52,-93.55 254.84,39.25 509.68,78.49 764.52,117.74 4.84,255.38 9.68,510.75 14.52,766.13 C 1359.67,966.67 933.87,957.53 508.06,948.39 598.93,784.94 689.78,621.51 780.65,458.06 712.9,428.49 645.16,398.92 577.42,369.35 c -98.39,0 -196.77,0 -295.16,0 -61.83,-3.76 -123.66,-7.53 -185.48,-11.29 10.22,-48.93 20.43,-97.85 30.65,-146.77 z" dur="10s" begin="0s" repeatCount="indefinite"/>
    There is another way to set the route of the object's movement. We create an element path and we save it. Then we contact him through mpath, wrapped around animateMotion. The code below is similar to the code above.
    <set href="#rect1" attributeName="x" to="0" begin="0" fill="freeze" /> <set href="#rect1" attributeName="y" to="0" begin="0" fill="freeze" /> <path id="shape" d="M 309.67742,420.96774 C 309.13978,395.16129 400,320.43011 446.77419,269.35484 c 46.7742,-51.07527 148.92473,29.03226 222.58065,43.54839 73.65591,14.51612 199.46236,77.41935 298.3871,117.74193 98.92476,40.32258 175.26886,-123.11828 264.51616,-187.09677 89.2473,-63.9785 201.0752,90.86021 301.6129,137.09677 100.5376,46.23656 -118.2796,173.65592 -175.8065,259.67742 C 1300.5376,726.34409 994.62366,756.98925 811.29032,817.74194 627.95699,878.49462 613.44086,742.47312 514.51613,704.83871 415.5914,667.2043 503.22581,587.09677 498.3871,527.41935 c -4.83871,-59.67741 18.8172,-59.67741 27.41935,-90.32258 8.60215,-30.64516 -51.6129,-18.27957 -77.41935,-27.41935 -25.80645,-9.13979 -91.39785,59.13978 -137.09678,88.70968 -45.69892,29.56989 -1.07527,-51.61291 -1.6129,-77.41936 z" fill="#ff"/> <animateMotion id="top" href="#rect1" dur="10s" begin="0s" repeatCount="indefinite"> <mpath xlink:href="#shape"/> </animateMotion>
    As a matter of fact, if you need to animate the path of the object, and this path is very difficult and thorny, then we open our favorite SVG editor (in my case, this is inkScape), draw this path and copy it like this:
    Then paste the copied path into the path attribute. You can learn about how this attribute is arranged and how to use it in this, exhaustive documentation. Or you can read a more simplified version in the context of use with SMIL.

    Animate colors

    Now let's talk about animating colors. As it was seen before, to animate colors you can use an animate, element or animateColor element. But it's better to use animate.
    <!-- Upper left square --> <animate href="#rect1" attributeName="fill" to="red" dur="3s" begin="0" repeatCount="indefinite" /> <!-- Upper right square --> <animate href="#rect1-8" attributeName="fill" from="#fff" to="#111" dur="3s" begin="0" repeatCount="indefinite" /> <!-- Lower left square --> <animate href="#rect1-8-5" attributeName="fill" values="#fff;#000;red;yellow" dur="3s" begin="0" repeatCount="indefinite" /> <!-- Lower right square --> <animate href="#rect1-8-1" attributeName="stroke" from="#fff" to="#111" dur="3s" begin="0" repeatCount="indefinite" />
    The first square, which is at the top left, is animated from the current color to the target.
    The second one, which is at the top right, animates the color from #FFF to #111 ignoring the original fill color.
    Third, which is at the bottom left, animates the colors step by step in the specified list in the attribute values.
    And the fourth square animates not the fill of the square but the stroke of the square.
    Animation rules apply to them the same as normal motion animations and transformations. Speaking of transformations ...

    Animate shapes

    This is one of those features of animated SVG images, for which it is worth learning this language. Just because it's so easy to do. For example, like this:
    <animate href="#rect1" attributeName="d" dur="3s" repeatCount="indefinite" from="m 707.51507,415 h 298.51823 c 9.7927,0 17.6764,7.88367 17.6764,17.67639 v 211.42142 c 0,9.79272 -7.8837,17.67639 -17.6764,17.67639 H 707.51507 c -9.79272,0 -17.67639,-7.88367 -17.67639,-17.67639 V 432.67639 c 0,-9.79272 7.88367,-17.67639 17.67639,-17.67639 z" values="m 707.51507,415 h 298.51823 c 9.7927,0 17.6764,7.88367 17.6764,17.67639 v 211.42142 c 0,9.79272 -7.8837,17.67639 -17.6764,17.67639 H 707.51507 c -9.79272,0 -17.67639,-7.88367 -17.67639,-17.67639 V 432.67639 c 0,-9.79272 7.88367,-17.67639 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 32.8334,140.4046 30.5796,149.93445 l -50,211.42142 c -2.2538,9.52985 -7.8837,17.67639 -17.6764,17.67639 H 707.51507 c -9.79272,0 -17.67639,-7.88367 -17.67639,-17.67639 V 432.67639 c 0,-9.79272 8.56559,-14.08603 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -61.1095,-38.77522 -70.9022,-38.77522 H 707.51507 c -9.79272,0 -17.67639,-7.88367 -17.67639,-17.67639 V 432.67639 c 0,-9.79272 8.56559,-14.08603 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -110.00464,48.20897 -119.2893,45.09575 L 707.51507,661.7742 c -9.28468,-3.11323 -17.67639,-7.88367 -17.67639,-17.67639 V 432.67639 c 0,-9.79272 8.56559,-14.08603 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 25.872,-54.65786 25.872,-64.45058 V 432.67639 c 0,-9.79272 8.56559,-14.08603 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -66.75319,-63.53923 -62.83768,-72.5151 l 88.70968,-203.3569 c 3.91551,-8.97586 8.56559,-14.08603 17.67639,-17.67639 z;M 707.51507,415 1043.1301,282.74194 c 9.1108,-3.59035 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 65.0172,3.65591 74.128,0.0655 z;m 705.90217,300.48387 337.22793,-17.74193 c 9.7791,-0.5145 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 62.7359,-113.93608 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 69.1714,6.27147 69.2893,16.06348 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 20.7078,8.05189 22.5151,17.67638 l 50,266.26013 c 1.8073,9.62449 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -62.7996,83.41975 -72.5151,82.19252 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -9.5118,25.19539 -19.2893,25.74091 l -346.90532,19.35483 c -9.77751,0.54551 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -9.4966,25.74091 -19.2893,25.74091 l -322.71177,-1e-5 c -9.79271,0 -88.44501,-43.47013 -87.03123,-53.16026 l 32.25807,-221.09884 c 1.41378,-9.69012 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -9.4966,25.74091 -19.2893,25.74091 l -322.71177,-1e-5 c -9.79271,0 -17.88728,-19.27487 -19.28929,-28.96671 L 633.38707,414.93445 c -1.40201,-9.69183 63.38863,-118.00094 72.5151,-114.45058 z;m 705.90217,300.48387 298.51823,116.12904 c 9.1264,3.55032 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -9.4966,25.74091 -19.2893,25.74091 l -322.71177,-1e-5 c -9.79271,0 -17.88728,-19.27487 -19.28929,-28.96671 L 633.38707,414.93445 c -1.40201,-9.69183 63.38863,-118.00094 72.5151,-114.45058 z;m 680.09572,421.45161 324.32468,-4.8387 c 9.7916,-0.14609 22.3773,7.88463 22.5151,17.67638 l 3.2258,229.16336 c 0.1378,9.79175 -9.4966,25.74091 -19.2893,25.74091 l -322.71177,-1e-5 c -9.79271,0 -19.14324,-19.17508 -19.28929,-28.96671 l -3.22581,-216.26013 c -0.14605,-9.79162 4.65895,-22.36901 14.45059,-22.5151 z" to="m 705.90217,300.48387 337.22793,-17.74193 c 9.7791,-0.5145 30.4617,140.14244 30.5796,149.93445 l 3.2258,267.87303 c 0.1179,9.79201 -109.5738,46.32298 -119.2893,45.09575 L 663.96668,708.54839 c -9.71551,-1.22723 -64.25146,-62.82497 -62.83768,-72.5151 l 32.25807,-221.09884 c 1.41378,-9.69012 62.7359,-113.93608 72.5151,-114.45058 z"></animate>
    This animation applies only to <path> elements
    I agree, there is a lot of code for such a simple morph of forms, but what is important to understand here. All this animation is possible thanks to the attributevalueswhich says step by step which nodes and where to place these nodes. Each step is separated by a semicolon.
    Moreover, it is quite important to take into account the fact that if you want to get exactly the animation, and not a sharp jump to the target point, it is necessary that the attribute path had an identical structure at each step. That is, if the first node is described by such a path structure - "M L L L L Z", then the second node should consist of the same structure.
    Here a rather reasonable question may arise, but how and where can I get the necessary positions of the nodes? I do not calculate these positions myself, but copy from a regular SVG editor - Inkscape. like this:
    In your editor, it may be a little different, but in Inkscape everything is quite straightforward and understandable.

    Object transformations

    If such a detailed transformation of paths is not needed, or you need to transform, for example, rect element, such an animation element will come to the rescue as animateTransform. It allows you to animate basic transformations as Scale, Rotate and Translate.
    To transform such transformations as Rotate and Scale to work correctly, you must put the following style for an animated element: style="transform-origin: center;" otherwise the transformation will be applied relative to the upper left corner of canvas.
    Here are examples of animations for object transformations:
    <animateTransform href="#rect1" attributeName="transform" type="translate" to="500,0" begin="0s" dur="1s" repeatCount="indefinite"></animateTransform>
    <animateTransform href="#layer1" attributeName="transform" type="scale" values="2,2; 2,1.5; 1,1.25" dur="5s" repeatCount="indefinite"></animateTransform>
    <animateTransform href="#layer1" attributeName="transform" type="rotate" values="90;-90;-45;45" begin="1s" dur="5s" repeatCount="indefinite"/>
    Note that I am using the attribute values to set the necessary rotation angles and the degree of zoom of the object step by step. It’s so easy to see this or that animation in action.

    Smooth animations

    Sometimes the movements may seem too sharp or "straight-line". And it doesn’t seem to you, because by default, all animated attributes change their properties in a straight line. To change this, you need to resort to such animate attributes as calcMode and keySplines.
    <animateMotion href="#rect1" to="700,0" dur="1s" calcMode="spline" keySplines="0 0 1 1" repeatCount="indefinite"></animateMotion> <animateMotion href="#rect1-8" to="700,0" dur="1s" calcMode="spline" keySplines=".5 0 .5 1" repeatCount="indefinite"></animateMotion> <animateMotion href="#rect1-8-5" to="700,0" dur="1s" calcMode="spline" keySplines="0 .75 .25 1" repeatCount="indefinite"></animateMotion> <animateMotion href="#rect1-8-5-1" to="700,0" dur="1s" calcMode="spline" keySplines="1 0 .25 .25" repeatCount="indefinite"></animateMotion>
    Need to be set calcMode equal to spline but in attribute keySplines you will have to write down the 4 numbers describing the spline curve. Together, they set the rate of change of animated attributes using splines.
    Generally calcMode a rather interesting attribute that can radically change the style and behavior of the animation. Of course, I could try to describe the work of this attribute, but it's probably better to leave it to those who developed the SMIL in the first place and just direct you to the official documentation for further review.
    It is worth considering the fact that Chromium browsers do not support splines from SMIL.
    I was too lazy to make an additional tool for generating such splines, maybe someday I will do it, but for now it can be used, here is the site specially designed to generate custom splines. Read more about how it works, in the official documentation.

    Interactive animations

    All my animations in this article begin immediately after loading the image itself into the DOM tree. In the code it looks like this: begin="0". And such behavior is standard, that is, it does not need to be prescribed yourself, it is implied.
    But sometimes you want the animation to be performed on a click on a specific element or with a mouse hover, for example. It's easy to implement using the Begin attribute not the time, but the names of the event, as I already did in this chapter. For example, can you open all the animations in this image:
    <animate id="one" href="#rect1" begin="mouseover" attributeName="fill" dur="1s" to="red" calcMode="spline" keySplines="1 0 .25 .25" /> <animate href="#rect1-8" begin="click" attributeName="fill" dur="1s" to="red" calcMode="spline" keySplines="1 0 .25 .25" /> <animate href="#path2" begin="mouseout" attributeName="fill" dur="1s" to="yellow" calcMode="spline" keySplines="1 0 .25 .25" /> <animate href="#path7" begin="click + 2s" attributeName="fill" dur="1s" to="green" calcMode="spline" keySplines="1 0 .25 .25" /> <animate href="#path1" begin="one.end;click" attributeName="fill" dur="1s" to="red" calcMode="spline" keySplines="1 0 .25 .25" />
    To start the animation for the first square, left-top, you just need to hover the mouse. You will have to click on the rectangle. Animation for a circle can be activated in two ways. The first is the usual click, the second is after the end of the animation of the square. The rounded triangle activates your animation after you remove the mouse. And finally, the animation for the pentagon will be activated 2 seconds after the click.
    Events should be used in conjunction with a specific animation element. Where first comes the id of the animation element, and then, through the point, there is an appeal to the event.
    Here are all the built-in events that can be used in begin and end attribute:
    1. begin - When the animation started
    2. end - when the animation is over, that is, if the number of repetitions is 5, then this event is activated only at the end of the 5th replay
    3. repeat - when the animation was repeated, that is, if the number of repetitions is 5, then at the end of each repetition.
    You can read more about built-in events here -> https://www.w3.org/tr/rec-smil/smil-timing.html#timing-domevents. Plus, since we work with SMIL via SVG - all other available events will be described here -> https://www.w3.org/tr/svg11/interact.html#svgevents

    Conclusion or what will be the next

    That's all I know about SVG images animations via SMIL. Minimal but quite sufficient toolkit to make pretty cool animations for your site.
    Just like with other articles of this type, the older it is, the more details this article will collect, because I will not stand still. And maybe I'll learn a couple or two tricks related to animations. And so, I hope the article was useful to you and helped you animate your SVG image in a short time.


    Do not forget to share, like and leave a comment :)

    Comments

    (0)

    captcha
    Send
    LOADING ...
    It's empty now. Be the first (o゚v゚)ノ

    Other

    Similar articles


    Quill formats(ql-formats), How to make custom format

    Clock
    24.10.2024
    /
    Clock
    02.10.2025
    An eye
    5760
    Hearts
    0
    Connected dots
    1
    Connected dots
    0
    Connected dots
    0
    In this article, I will analyze the types of quilljs formats and explain some of the nuances of working with tables, fonts, images, and video. I will also show how …

    Quill tooltip, how to make your own. Example on links

    Clock
    25.10.2024
    /
    Clock
    02.10.2025
    An eye
    2852
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0
    In this article, you will find an example of how to implement your own Quill tooltip. And you will get how this even works. As an example, a tooltip will …