【CSS3】Transitions & Transfoms アニメーション
@keyframesなど
by tea4two
HTML
<link rel="stylesheet" href="http://yui.yahooapis.com/3.10.3/build/cssreset/cssreset-min.css">
<small>copyright © 2013 うにゃうにゃうにゃCo.,LTD.</small>
CSS
html,body {
background-color: #ccc;
}
@-webkit-keyframes BG {
0% { background-color: #fff; }
25% { background-color: #fff5a5; }
50% { background-color: #ffd4da; }
75% { background-color: #99d2e4; }
100% { background-color: #d8cab4; }
}
@-moz-keyframes BG {
0% { background-color: #fff; }
25% { background-color: #fff5a5; }
50% { background-color: #ffd4da; }
75% { background-color: #99d2e4; }
100% { background-color: #d8cab4; }
}
@-o-keyframes BG {
0% { background-color: #fff; }
25% { background-color: #fff5a5; }
50% { background-color: #ffd4da; }
75% { background-color: #99d2e4; }
100% { background-color: #d8cab4; }
}
@keyframes BG {
0% { background-color: #fff; }
25% { background-color: #fff5a5; }
50% { background-color: #ffd4da; }
75% { background-color: #99d2e4; }
100% { background-color: #d8cab4; }
}
@-webkit-keyframes copyright {
0% { color: #fff; }
50% { color: purple; }
100% { color: skyblue; }
}
@-moz-keyframes copyright {
0% { color: #fff; }
50% { color: purple; }
100% { color: skyblue; }
}
@-o-keyframes copyright {
0% { color: #fff; }
50% { color: purple; }
100% { color: skyblue; }
}
@keyframes copyright {
0% { color: #fff; }
50% { color: purple; }
100% { color: skyblue; }
}
small {
display: block;
background: #fff;
padding: 20px;
color: #000;
font-weight: bold;
font-size: 120%;
-webkit-animation-name: BG, copyright;
-moz-animation-name: BG, coptyright;
animation-name: BG, coptyright;
-webkit-animation-duration: 5s,3s;
-moz-animation-duration: 5s,3s;
animation-duration: 5s,3s;
-webkit-animation-timing-function: ease,ease;
-moz-animation-timing-function: ease,ease;
animation-timing-function: ease,ease;
-webkit-animation-iteration-count: infinite,infinite;
-moz-animation-iteration-count: infinite,infinite;
animation-iteration-count: infinite,infinite;
...