CSS3 Animation notation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.