Types of animation in computer graphics

In this article you will learn another look at further development animation. Will 3D animation supplant 2D or will they go on parallel roads. About some features of animation production in these styles

“2D animation is dead”. We hear this phrase everywhere, despite recent short films that have been nominated for Oscars.

Regardless of whether classical animation is really dead or not, today we will try to look at the situation from a different angle, and understand the reasons why 2D animation should remain in the past.

2D animation is the passion of my life, which has been walking with me side by side for many years. During my career, I realized that you need to learn to look at any situation from different angles. Since people say “2D animation is dead”, we need to know WHY they say that, and also understand why it is good and why it is bad. There are no hype hyperboles in this article. Just dry facts. Let's get started.

1. 3D is easier.

Yes, there are animators who will foam at the mouth and prove to you that 3D animation is NOT easier than 2D, until you run out of the room and hide in a safe place. But please consider my point of view.

Animation is animation. This is not a style, or even a type (2D, 3D, stop motion, etc.). Regardless of the medium in which you animate, you will use the same principles as in 2D, 3D, 5D, and any other form of animation. Therefore, LITERALLY no form of animation is more difficult or easier. This is a subjective indicator. Therefore, we must pay attention to the PROCESS.

Let's say you have an animator who is a master of his craft. Hypothetically, she has no animation experience, but she has theoretical skills that Glen Keane himself would envy. It would be a waste of time, effort and talent not to let this animator get busy, so it's our duty to give her a job.

In order to apply her knowledge in 3D, she will need to study 3D software. Learning new software – difficult task, but doable. By attending, for example, certain courses and studying certain literature, our hypothetical animator will be able to apply his theoretical super-knowledge in 3D space.

In order to apply her knowledge in 2D, however, she will also have to learn a lot - the basics of drawing at a master level. But there is no clear reference book with instructions here, since there is no program here. You can attend courses, but they will only be the first step, since you will be learning to draw all your life, unlike pressing buttons in a program.

Don't believe my words, check them.

Take paper, make a hundred drawings of different poses, and try to ensure that the character (which, by the way, you didn’t come up with) in each pose remains the same character, with the same proportions and design. This is a complete nightmare.

No, I’m not saying that 3D animation is really easy, because let me remind you that animation is animation. This is the skill needed to bring an image to life and transfer it to the screen. One requires confident use of software, the other requires masterful drawing skills, such that Da Vinci would put down his pen and throw his work into the trash bin out of envy.

The truth is that such artists are becoming fewer and fewer every day. This is because animation is an art form that is passed on from teacher to student. You need a more experienced animator to point out your mistakes. and the fewer such teachers remain, the fewer students continue their work.

Of course, we can use various techniques to make certain things easier, but then we have to ask ourselves: IS IT WORTH IT?

2. Computers are superior to humans.

Have we already lit a nice fire? Let's throw some more firewood.

The simple fact is that a computer is capable of doing anything at a level of detail and perfection that no human being can do the same. Don't believe me? Try doing this manually:

Some may argue: “Well, they simply don’t make this type of footage in 2D. It’s done differently there.” The question then remains: Why? Why and why should we limit ourselves in something when technology is already here in your hands and can allow you unlimited possibilities. Why go back and do something that is more difficult to do, also in a limited format? Why not accept the future and live in the past?

These are questions that every animator must answer, no matter how or where they use their skills. We MUST ask: “Is this The best way? Can we tell the story better this way (after all, that's what matters most)? Will there be a better connection between character and viewer? Will these beautiful realistic waves help the shot, or should they be muted, because despite their beauty and steepness, they are distracting?”

Using technology for technology's sake is a fool's errand. The same thing as doing things “the old way” because that’s how they used to do it. If the new method is superior to the old one, if it gives you new opportunities, then abandoning it is a stupid idea for the sake of nostalgia. As artists/technicians, we MUST KNOW WHY WE CHOOSE a particular technique/method/method/medium to achieve our goals, and this choice should never be “because someone else did it.” to be inspired by our mentors, our “artistic ancestors,” is wonderful. But comparing yourself to them, or worse, trying to become them, is a sure way to screw up. They are them, and we are us.

3. Computers are superior to humans. (accuracy)

I asked one of the coolest animators of our time, Tom Bancroft, about “What makes 3D animation better” and received this answer:

“One thing that 3D animation (and certainly the people behind it) does better than 2D is precision. I would say extreme precision. I worked on some of these scenes in one of the most accurate films of the 20th century, Disney: Pocahontas (for example, when she thinks about her dead mother). I can attest that even with the best in-between shots and the best wedge-ups, it's incredibly difficult to show a character barely moving for long periods of time, especially when later shown on really big screens where everything is visible. And in the days of 2D animation at Disney, we couldn’t afford to use the same character sheet, otherwise it would become inanimate and blend into the background. And in computer animation it's not a problem to do this. It became easy to barely move anything. No jittery lines. Many top CG animators actively use this feature. And at the same time, CG animators often use 2D animation for preview. And this definitely makes sense.

Has the pendulum of our art swung too far? Yes, I think that's exactly what we're seeing now. Ultra-realistic animation, which in its believability resembles a feature film, and therefore, the magic that lies at the center of the art of animation is lost in it.”

Tom noticed very important point: “3D animation (and, of course, the people behind it).” Many people (non-artists) think that the computer does all the work for us. When I say that computers are superior to humans, I am saying that the computer, as a tool, has a greater degree of precision. This allows animators to do things that a pencil can't. And as already said, animation is animation, no matter what.

4. Changes are ahead of us.

Let's say you have a scene in 3D and your director suddenly realizes that it would be better to show it from a bird's eye view, and not from the point of view of a worm, as is now the case. You can pull off such a scam in 3D without any problems! A small adjustment to the existing camera and voila. And in 2D? All you have to do is throw a chair at the nearest screenwriter. In 2D, the animator will have to not only redo the scene, but start from scratch. Literally. New sketches, tons of sketches, searching for the optimal angle of view of the scene...instead of just slightly adjusting the virtual camera as they do now in 3D. So making the changes that inevitably follow the script will not only be faster, but also cheaper for production.

5. 3D is more real.

Let's go a little beyond the scope of this article. While preparing the material, I asked some of my colleagues why, hypothetically, 3D is the only development of future animation. Some of the interviewees were animators, and they asked if I was sick in the head. Some were just enthusiasts. One, however, was just a friend of mine who is associated with animation solely with a chair and popcorn at the cinema to which I invited him. Outside of his childhood, he rarely ever took the initiative to watch any cartoon. I asked if he had watched “Frozen”? No. What about “City of Heroes” or “How to Train Your Dragon 2”? No. I didn't even bother asking if he had seen The Tale of the Princess Kaguya. He watched the animated series Hercules, as he is a fan of Greek mythology, but admitted that he did not enjoy watching the film itself.

To my question: “Why 3D?” his answer was obvious and simply outrageous - she is more realistic. for him, 3D animation “blurs the lines between reality and fantasy,” and for him it’s a way to theoretically realize some of his fantasies.

And if you ask any 2D animator the same question, they will tell you that convincing characters make what is happening real, and in this they are superior to any technology, design and models (3D). But the problem is that it’s not the animators who go to the cinemas. The halls are filled with various people who have no idea how animation is made and works. For them, “3D animation is more real.”

You can dispute this fact as much as you like from the point of view of a creative person who is directly familiar with the process/history, etc. of animation. But you must always remember the TARGET AUDIENCE.

As I already mentioned, while writing this article, I spoke with different people from different fields. Charles Kenny - author of AnimationAnomaly.com shared an interesting point of view that I had never thought about before: Infrastructure.

“Traditional animation, which is under constant pressure from CG, does not have nearly the same impressive capital and technical development. If you, as an investor, want to invest in a render farm or software development, then you are interested in your product being reusable, which corresponds to 3D animation.”

Samantha Youssef of Studio Technique has this to say in her upcoming book, Movements and Forms:

“Ultimately, I believe that 3D is more efficient from a business perspective, and the industry is primarily a business, not an art. No matter how many wonderful artists work in this industry, no matter what masterpiece projects are developed, the motivation will always be the same - money.”

The above is a fat point from a logical point of view. (Yes, yes, we artists often ignore logic, but it exists, believe me). Today, studios are putting much more effort, investment, and hope into 3D production.

Of course, thanks to the same, Sintika can continue to be animated using classical techniques, but nowadays, given the growth in demand, tight deadlines, marketing and other abstruse terms, preference is given to computerization.

None decision will not allow already created expensive software, render farms and technologies to collect dust while animators sharpen their pencils. And whether you want to admit it or not, our industry is business, and only then art. If the 3D tools are already here, the infrastructure is established, and the workflow is perfected, then why not use it COMPETENTLY?

Let's summarize.

When I started collecting material for this article, I did it only because I am one hundred percent a 2D fan and it was interesting for me to look at the situation from a different angle. By the end of my research, I had almost convinced myself that it was worth honoring 2D's memory and not waiting for her to slowly die in our arms.

But still.

As you can see, there is one reason that refuses to capitulate from the depths of my mind regarding the fact that 2D must go on. Compared to the facts provided above, it is completely illogical and irrational. However, this is the most compelling reason:

2D ANIMATION = PEOPLE.

I have watched and loved many 3D animated films. They were convincing, with rich visuals and inner world. However, I never felt as much “human” in them as I did in 2D animation.

By giving the machine some control over what happens, I truly believe that we lose a piece of soul in the final product. Of course, there are many who will not agree with me (but in this article you can challenge any of my words =)), saying that the computer is just a tool, like before it there was a pencil, before which there was an ember from a fire and a cave wall. This is a fair point and I accept it. At the same time, there will be animators who claim that 101 Dalmatians and The Jungle Book were the pinnacle of animation due to the animator's raw lines that were not polished to machine precision.


People aren't perfect. And in my opinion, it is thanks to our flaws that we create the great things that we create. And there are things that only an imperfect person can do perfectly. Living lines of the drawing, uneven edges, “mistakes” as some might say - this is exactly what attracts me to 2D animation. You look much deeper than these very lines, shapes and spots.

Sounds snotty? Because that's who we are. People. We are human, and we are characterized by such feelings as love, hatred and a ton of other complex feelings. By removing this element, even just allowing the computer to do the job “cleanly,” we lose 2D and what is hidden in it. It is this argument that will always be on the scales of my scales “For 2D and against 3D”. While we are alive, those who know and remember 2D animation in its best years, she will also be alive.

01/03/17 6.3K

Animation techniques are constantly evolving, and game developers and film studios are constantly looking for talented and creative individuals who can apply these techniques.


Here are the main types of animation that can be used to create digital characters for television shows, commercial applications, company logos, movies, videos or games.
  • Traditional animation.
  • 2D vector animation.
  • 3D computer animation.
  • Motion graphics.
  • Stop motion.

Traditional animation

Have you ever seen images that appear as frames in quick succession, drawn on transparent sheets of paper with colored markers? This type of computer animation is called traditional. It is used for preliminary character sketches.

This process can be quite expensive and time-consuming, as animators have to create a series of different frames based on the 24 frames per second frame rate. This method is used mainly on PCs, as well as tablets using special computer programs, allowing you to create animation in the style of old Disney cartoons.

2D vector animation

The most commonly used animation style. Its frames are created on a relatively flat surface. In addition, vector animation has adopted some traditional animation techniques. In reality, it is the same as traditional animation, except that a process known as shading and shading is applied to the frames.

During this process, animators place thin, transparent sheets of celluloid onto paper on which animated characters are drawn, and then transfer them onto film. At the end there are stills from different characters overlap each other, and due to the high transparency of the film, this allows you to create a composition from various elements and characters.

3D computer animation

3D animation is completely different from other types of animation in computer graphics. Although they use the same principles of composition and movement, the technical methods used to solve the various problems differ significantly. In 3D animation, the animator does not need to be a graphic artist. It's more like playing with dolls than drawing.

These are also called computer-generated images ( CGI). They occur when computer animators create a stream of images that are brought together to form an animation. Combining dynamic and static images is done using computer graphics. Characters created in 3D are digitally displayed on screen and then combined with the wireframe, allowing each model to be animated differently.

Animation is created by creating models in individual key frames, and then the computer multiplies them, interpreting the animation by adding intermediate frames between key frames.

In addition, a lot of time is spent working with curves representing different parts of the object at different periods of time. In 3D animation, all characters must be taken into account, even those that are certain moment time are blocked by something and are not visible.

The main difference between these types of animation is that in traditional and 2D animation the artist works on individual frames, while in 3D animation there is always a continuous flow. If it stops, it is perceived as an error. Even when the character remains in place, there is always a continuous flow of frames that creates the illusion of reality.

Motion graphics

Have you ever wondered how promotional videos, animated logos, movie opening credits, and app advertisements are created? This is done using moving graphic texts and elements, or as I call it, motion graphics.

This is a process that uses "multiplication" of animated frames to create smooth movement between frames. Frame multiplication programs support scripts that automatically change the animation to create numerous effects.

3D compositions are created from flat elements moving relative to each other, which creates the illusion of volume. They may also be accompanied by sound effects or music. Such objects are often used in multimedia projects.

Stop motion

Stop motion is a type of computer animation that is more similar to traditional animation. All you have to do is take a photo of an object, and when you move the object a relatively short distance, you take another photo. This procedure is repeated repeatedly, and when the images are played one after another, the impression of movement is created.

Creating a 2D cartoon in KINESKO is:

The price of 2D animation depends on such factors

  1. Timing of the video.
  2. Complexity of animation. The more detailed the drawing, the higher the price of 2D animation.
  3. Availability of additional services(voiceover, promotion, etc.).

Stages of creating 2D animation

1. Creating 2D animation starts with collection and analysis of initial information, on the basis of which it is formed idea. After its agreement with the customer, it is written scenario.

2. The next stage of making 2D animation is character design development. It begins with a sketch drawn by the artist, which is later refined and simplified. The artist comes up with appearance characters, their emotions and even the sounds they make.

3. Then we proceed to creating a storyboard, preliminary visualization of the video. It allows animators to understand how the final video should look (angle, appearance and behavior of characters, etc.).

4. A storyboard is used to create video key frames. After drawing them, work begins on creating intermediate frames(phasing). Drawing in parallel backgrounds.

5. After the 2D animation production work is completed, there is still voice acting And adding sound effects.

Order with 2D animation service

Why You Should Make 2D Animation

1. In 3D animation there are many limitations when constructing a frame or scene. Creating 2D animation is much easier. 2D characters are more flexible and have better facial expressions which contributes to their memorability. 3D models created differently, their every movement calculated by mathematical formulas.

2. 2D animation uses more visual effects than 3D, which greatly speeds up work.

3. Character animation in 2D videos costs less than in volumetric ones.

4. In 2D animation, information can fill the entire screen. Whereas in 3D videos, landmarks in space take up part of the screen and reduce the number of working pixels.

5. For voluminous characters, the hair may “sink” into the texture of the head, and the ears may go through the hat. There are no such problems with 2D animated characters.


1. "Rubber" hero. The bodies of the drawn characters are often compressed and stretched. And yet the volume of the body must remain the same.

2. Preparatory movements. Before performing any action, a person usually makes preparatory movements. In animation this technique is exaggerated. Mainly to notify the viewer of what will happen next.

3. Stage performance. The poses and facial expressions of animated characters should be simple and expressive.

4. Endless movement. Even if a two-dimensional character is static, the supporting elements should be in constant motion.

5. Movement in arcs. Living things always move along an arc-shaped path. Although sudden movements may appear to be straight, this is deceiving.

6. Caricature. Animation and realism are difficult things to combine. A happy character should shine like the sun, while an angry character should look like a cauldron ready to explode.

7. Attractiveness of the characters. Even a scary troll living in a swamp can be attractive. If the character seems boring, the whole film will seem so.

How to make an animated character cute?

  • the character should look like a child;
  • his main character traits are modesty and self-doubt;
  • his head should be larger than his body, and his eyes should be low-set;
  • his body should be plump, emphasizing a good appetite.

The Evolution of 2D Animation Creation

1. "Steamboat Willie"(1928) is the first sound cartoon. This is also the third cartoon in which Mickey Mouse appears.

2. "Snow White and the Seven Dwarfs"(1937) became the first full-length color cartoon. She even received an Oscar for her innovative achievements.

3. "Mary Poppins"(1964) is not the first film to combine live action with animation. However, this is the main example of the use of such technology, without which Who Framed Roger Rabbit and other famous films would not exist.

4. "The Adventures of Fritz the Cat"(1962) was the first cartoon to receive an X rating. Because of its erotic and violent scenes, it was never shown on television, but it became a starting point in the history of adult animation.

5. "Akira"(1988) was released after Hayao Miyazaki founded his famous Studio Ghibli. But it was she who served as the impetus for the popularization of anime in America and the rest of the world, opening the way for the films of the aforementioned Miyazaki, Evangelion and many others.

6. "Vinnie Bear and His Friends" became Disney's last hand-drawn cartoon, marking the end of an era.

This is a rather provocative question that worries many people. It all started from the moment when such a giant animation monster as Disney (the founder of the style) announced the closure of its 2D department. The question on everyone's mind is, what does this mean for the future of classical animation? Does this mean there will be no more classic animation?

More and more often I come across young professionals who prefer 2D animation, but work in 3D. When I ask them why, the answer is mostly the same - “But there is no future for 2D animation. Classic animation is dead! But is this true? Is 2D animation really dead? Let's figure it out.

To begin with, “2D animation” and “classical animation” are two completely different concepts. One of them means the direction, type of animation, “2D” - flat, two-dimensional animation. And another concept means technology. The classic technique is working on an animation table using Disney's 12 principles. These two concepts should never be confused.

“Classical animation”, the decoding of this concept in the name itself is “CLASSIC”. For many years, animation was done on animation tables, using the same unchanged 12 principles that were invented a long time ago. This is a classic, like other good classical things in our world, like the music of Mozart for example. Their time passes, but we still appreciate them and move on, using the accumulated experience. But we cannot say that classical animation is dead. It has just undergone changes, keeping up with the times and adapting to the requirements of a new generation of viewers.

Now it’s difficult to talk about one specific type of animation. The boundaries have been erased. Rarely at the very beginning of a project does a studio know whether it is going to be a 2D or 3D project. First, testing is carried out - in which direction of animation the idea will be clearest, easiest to create and, of course, fastest. And only then, based on the results of numerous tests, sometimes even many years, it is decided what equipment will be used.

CSS3 animation Gives sites dynamism. It brings web pages to life, improving the user experience. Unlike CSS3 transitions, animation creation is based on keyframes, which allow you to automatically play and repeat effects for a given time, as well as stop the animation within a loop.

CSS3 animation can be used for almost all html elements, as well as the:before and:after pseudo-elements. The list of animated properties is given on the page. When creating animations, do not forget about possible performance problems, since changing some properties requires a lot of resources.

Introduction to CSS Animation

Browser support

IE: 10.0
Firefox: 16.0, 5.0 -moz-
Chrome: 43.0, 4.0 -webkit-
Safari: 4.0 -webkit-
Opera: 12.1, 12.0 -o-
iOS Safari: 9, 7.1 -webkit-
Opera Mini:
Android Browser: 44, 4.1 -webkit-
Chrome for Android: 44

1. Keyframes

Keyframes are used to specify animation property values ​​at various points in the animation. Keyframes define the behavior of one animation cycle; the animation can repeat zero or more times.

Keyframes are specified using the @keyframes rule, defined as follows:

@keyframes animation name (rules list)

Animation creation begins with installation key frames@keyframes rules. Frames determine which properties will be animated at which step. Each frame may include one or more declaration blocks of one or more property and value pairs. The @keyframes rule contains the name of the element's animation, which links the rule and the element's declaration block.

@keyframes shadow ( from (text-shadow: 0 0 3px black;) 50% (text-shadow: 0 0 30px black;) to (text-shadow: 0 0 3px black;) )

Keyframes are created using the from and to keywords (equivalent to the values ​​0% and 100%) or using percentage points, which can be specified as many as you like. You can also combine keywords and percentage points. If frames have the same properties and values, they can be combined into one declaration:

@keyframes move ( from, to ( top: 0; left: 0; ) 25%, 75% (top: 100%;) 50% (top: 50%;) )

If 0% or 100% frames are not specified, then the user's browser creates them using the calculated (originally set) values ​​of the animated property.

If multiple @keyframes rules are defined with the same name, the last one in document order will fire and all previous ones will be ignored.

Once the @keyframes rule is declared, we can reference it in the animation property:

H1 ( font-size: 3.5em; color: darkmagenta; animation: shadow 2s infinite ease-in-out; )

It is not recommended to animate non-numeric values ​​(with rare exceptions), as the result in the browser may be unpredictable. You should also not create keyframes for property values ​​that do not have a midpoint, such as property values ​​color: pink and color: #ffffff , width: auto and width: 100px , or border-radius: 0 and border-radius: 50% ( in this case, it would be correct to specify border-radius: 0%).

1.1. Timing function for key frames

A keyframe style rule can also declare a temporary function that should be used when the animation moves to the next keyframe.

Example

@keyframes bounce ( from ( top: 100px; animation-timing-function: ease-out; ) 25% ( top: 50px; animation-timing-function: ease-in; ) 50% ( top: 100px; animation-timing- function: ease-out; ) 75% ( top: 75px; animation-timing-function: ease-in; ) to ( top: 100px; ) )

Five keyframes are specified for the animation named "bounce". Between the first and second keyframe (that is, between 0% and 25%), the easing function is used. Between the second and third keyframe (that is, between 25% and 50%), the smooth acceleration function is used. And so on. The element will move up the page by 50px, slowing down as it reaches its highest point, and then speeding up as it drops to 100px. The second half of the animation behaves similarly, but only moves the element 25px up the page.

The timing function specified in the to or 100% keyframe is ignored.

2. Animation name: animation-name property

The animation-name property specifies the list of animations applied to the element. Each name is used to select a keyframe in a rule that provides property values ​​for the animation. If the name does not match any keyframes in the rule, there are no properties to animate, or there is no animation name, the animation will not execute.

If multiple animations attempt to change the same property, the animation closest to the end of the list of names will execute.

The animation name is case sensitive and the none keyword is not allowed. It is recommended to use a name that reflects the essence of the animation, and you can use one or more words listed with a hyphen - or the underscore character _ .

The property is not inherited.

Syntax

Animation-name: none; animation-name: test-01; animation-name: -sliding; animation-name: moving-vertically; animation-name: test2; animation-name: test3, move4; animation-name: initial; animation-name: inherit;

3. Animation duration: animation-duration property

The animation-duration property specifies the duration of one animation cycle. Specified in seconds s or milliseconds ms. If an element has more than one animation specified, you can set a different time for each by listing the values ​​separated by commas.

The property is not inherited.

Syntax

Animation-duration: .5s; animation-duration: 200ms; animation-duration: 2s, 10s; animation-duration: 15s, 30s, 200ms;

4. Timing function: animation-timing-function property

The animation-timing-function property describes how the animation will progress between each pair of keyframes. During animation delay, timing functions are not applied.

The property is not inherited.

animation-timing-function
Values:
linear Linear function, animation occurs evenly throughout the entire time, without fluctuations in speed.
Bezier functions
ease The default feature, the animation starts slow, accelerates quickly, and slows down at the end. Corresponds to cubic-bezier(0.25,0.1,0.25,1) .
ease-in The animation starts slowly and then smoothly speeds up at the end. Corresponds to cubic-bezier(0.42,0,1,1) .
ease-out The animation starts quickly and slows down smoothly at the end. Corresponds to cubic-bezier(0,0,0.58,1) .
ease-in-out The animation starts slowly and ends slowly. Corresponds to cubic-bezier(0.42,0,0.58,1) .
cubic-bezier(x1, y1, x2, y2) Allows you to manually set values ​​from 0 to 1. You can build any trajectory of the speed of animation change.
step functions
step-start Sets step-by-step animation, breaking the animation into segments, changes occur at the beginning of each step. Evaluated in steps(1, start) .
step-end Step-by-step animation, changes occur at the end of each step. Evaluated in steps(1, end) .
steps(number of steps, step position) A step time function that takes two parameters. The first parameter specifies the number of intervals in the function. This must be a positive integer greater than 0, unless the second argument is jump-none, in which case it must be a positive integer greater than 1. The second parameter, which is optional, specifies the step position - the point at which the animation begins, using one of the following values:
  • jump-start - the first step occurs at a value of 0
  • jump-end - last step occurs at value 1
  • jump-none - all steps occur within the range (0, 1)
  • jump-both - the first step occurs with a value of 0, the last - with a value of 1
  • start - behaves like jump-start
  • end - behaves like a jump-end

With the value start the animation starts at the beginning of each step, with the value end at the end of each step with a delay. Latency is calculated by dividing the animation time by the number of steps. If the second parameter is not specified, the default value end is used.

initial
inherit

Syntax

Animation-timing-function: ease; animation-timing-function: ease-in; animation-timing-function: ease-out; animation-timing-function: ease-in-out; animation-timing-function: linear; animation-timing-function: step-start; animation-timing-function: step-end; animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); animation-timing-function: steps(4, end); animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); animation-timing-function: initial; animation-timing-function: inherit;

Step-by-step animation can be used to create interesting effects, such as text being printed or a loading indicator.

5. Animation repetition: animation-iteration-count property

The animation-iteration-count property specifies the number of times the animation loop is played. A starting value of 1 means that the animation will play from start to finish once. This property is often used in conjunction with the animation-direction property's alternate value, which causes the animation to play in reverse order in alternate loops.

The property is not inherited.

Syntax

Animation-iteration-count: infinite; animation-iteration-count: 3; animation-iteration-count: 2.5; animation-iteration-count: 2, 0, infinite;

6. Animation direction: animation-direction property

The animation-direction property determines whether the animation should play in reverse order on some or all loops. When the animation is played in reverse order, the timing functions are also reversed. For example, when played in reverse order, the ease-in function will behave like ease-out .

The property is not inherited.

animation-direction
Values:
normal All animation repeats play as specified. Default value.
reverse All animation repeats play in the opposite direction from how they were defined.
alternate Each odd repeat of the animation loop plays in the normal direction, each even repeat plays in the reverse direction.
alternate-reverse Every odd repetition of the animation loop plays in the reverse direction, every even repetition plays in the normal direction.
initial Sets the property value to the default value.
inherit Inherits the property value from the parent element.

To determine whether an animation loop repeat is even or odd, the number of repeats starts at 1.

Syntax

Animation-direction: normal; animation-direction: reverse; animation-direction: alternate; animation-direction: alternate-reverse; animation-direction: normal, reverse; animation-direction: alternate, reverse, normal; animation-direction: initial; animation-direction: inherit;

7. Playing animation: animation-play-state property

The animation-play-state property determines whether the animation will start or pause. Stopping animation within a loop is possible by using this property in a JavaScript script. You can also stop the animation when you hover the mouse over an object - state:hover .

The property is not inherited.

Syntax

Animation-play-state: running; animation-play-state: paused; animation-play-state: paused, running, running; animation-play-state: initial; animation-play-state: inherit;

8. Animation delay: animation-delay property

The animation-delay property determines when the animation will start. Specified in seconds s or milliseconds ms.

The property is not inherited.

Syntax

Animation-delay: 5s; animation-delay: 3s, 10ms;

9. State of the element before and after playing the animation: animation-fill-mode property

The animation-fill-mode property determines what values ​​are applied by the animation outside of its execution time. When the animation completes, the element returns to its original styles. By default, animation does not affect property values ​​when animation is applied to an element - animation-name and animation-delay . Additionally, by default, animations do not affect the values ​​of the animation-duration and animation-iteration-count properties after they are completed. The animation-fill-mode property can override this behavior.

The property is not inherited.

animation-fill-mode
Values:
none Default value. The element's state does not change before or after the animation plays.
forwards Once the animation ends (as determined by the animation-iteration-count value), the animation will apply the property values ​​at the time the animation ends. If animation-iteration-count is greater than zero, the values ​​for the end of the last completed iteration of the animation are applied (not the value for the start of the iteration that comes next). If animation-iteration-count is zero, the applied values ​​will be those that start the first iteration (same as in animation-fill-mode: backwards;).
backwards During the period defined with animation-delay , the animation will apply the property values ​​defined in the keyframe, which will begin the first iteration of the animation. These are either the from keyframe values ​​(when animation-direction: normal or animation-direction: alternate) or the to keyframe values ​​(when animation-direction: reverse or animation-direction: alternate).
both Allows you to leave an element in the first keyframe before the animation begins (ignoring a positive delay value) and delay on the last frame until the end of the last animation.

Syntax

Animation-fill-mode: none; animation-fill-mode: forwards; animation-fill-mode: backwards; animation-fill-mode: both; animation-fill-mode: none, backwards; animation-fill-mode: both, forwards, none;

10. Brief description of animation: animation property

All animation playback parameters can be combined in one property - animation , listing them separated by a space:

Animation: animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction;

To play the animation, it is enough to specify only two properties - animation-name and animation-duration , the remaining properties will take their default values. The order in which the properties are listed does not matter, the only thing is that the execution time of the animation-duration must come before the animation-delay delay.

11. Multiple animations

For one element, you can set several animations, listing their names separated by commas:

Div (animation: shadow 1s ease-in-out 0.5s alternate, move 5s linear 2s;)



Indian Solitaire