CSS3 The animation through @keyframes definition animation, animation set animation properties, so as to achieve the animated effect;
In the animation attribute, you can specify the name of the animation, the running time of the entire animation, the speed curve of the motion, and its delay time, number of plays, and so on.
Animation
Animation, as a composite property, includes the following animation properties.
Animation-name-------------------------------------Specify the name of the animation
Animation-duration---------------------------------Specify the time that the animation finishes once
Animation-timing-function----------------------The motion velocity curve of the specified animation
Animation-delay------------------------------------Specify the delay time of the animation
Animation-iteration-count-----------------------Specify the number of times the animation plays
Animation-direction------------------------------Specify whether the next cycle of animation starts in reverse
Animation-fill-mode-------------------------------states outside the animation time
Animation-play-state------------------------------Specify the animation to run and pause
Animation-timing-function
Specifies the speed curve of the animation. The default is "ease". The following are some of the most commonly used motion velocity curves:
Linear: Linear transition.
Ease-in: from slow to fast.
Ease-out: From fast to slow.
Ease-in-out: From slow to fast to slow.
You can also directly use the speed curve specified by the Bezier curve, and the 4 values of the Bezier curve must be within the [0, 1] interval.
Animation-direction
Specifies whether the animation will play backwards in the next cycle. The default is "normal".
Reverse: Opposite direction movement
Alternate: The normal direction and then the opposite direction of movement, continuous alternating
Alternate-reverse: Moving in the opposite direction again in the normal direction, continuously alternating
Animation-fill-mode
Specifies the state outside the object's animation time. Common values are as follows:
Circular motion Trajectory
The
Implementation code is as follows:
<! DOCTYPE html>
The following points are noted in the code above:
The body height 100% is set due to the body's default height of 0 in the HTML5 environment
The spaces between the "-" and "+" between values and values are essential during the use of Calc
The left and top values in the animation are the starting and ending positions of the object motion, and note the border value
Only half the motion of the animation is executed at once
Speed curve: Cubic-bezier (0.36,0,0.64,1);
Two-direction delay time setting x:-2s; y:0s
The first positive direction and then the opposite direction continuously alternately runs: alternate