Today, I groped for the CSS3 animation, mainly compatible with the WebKit engine. Here is my simple implementation of a loop playing home in the animation, the code is as follows:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <title>Chasing Dot</title> <styletype= "Text/css">. Spiner{//define containermargin:100px Auto;width:40px;Height:40px;position:relative;text-align:Center;-webkit-animation:rotate 2s infinite linear;//Container load rotation animation, time 2s, infinite loop, linear speedAnimation:rotate 2s infinite linear; }. Dot1,. Dot2{//define motion elements can be replaced by pseudo-elementsposition:Absolute;width:60%;Height:60%;Display:Inline-block;Top:0;Background-color:#333;Border-radius:100%;-webkit-animation:zoom 2s infinite linear;//Motion Load Zoom animation, time 2S, infinite loop, linear speedAnimation:zoom 2s infinite linear; }. Dot2{Top:Auto;Bottom:0;-webkit-animation-delay:-1.0s;Animation-delay:-1.0s; }@-webkit-keyframes Rotate{//define rotation animation (compatible with WebKit notation)100%{-webkit-transform:Rotate (360deg)}} @keyframes Rotate{//compatible with the wording100%{Transform:Rotate (360deg);-webkit-transform:Rotate (360deg); }} @-webkit-keyframes Zoom{//define scaling animations (compatible with WebKit notation)0%,100%{-webkit-transform:Scale (0.0)}50%{-webkit-transform:Scale (1.0)}} @keyframes Zoom{//compatible with the wording0%,100%{Transform:Scale (0.0);-webkit-transform:Scale (0.0); }50%{Transform:Scale (1.0);-webkit-transform:Scale (1.0); } } </style> </Head> <Body> <Divclass= "Spiner"> <Divclass= "Dot1"></Div> <Divclass= "Dot2"></Div> </Div> </Body></HTML>
The effect is:
Where the motion speed of the animation is the parameter:
transition-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-
Is it clear, record, go on,fighting!
CSS3 Animation notation