今天就寫乙個css3拋物線的動畫吧= =
從左到右的拋物線動畫,我們就暫且把動作分為勻速向右運動和變速的上下運動。
水平勻速運動我們可以利用 translatex(x):定義 2d 轉換,沿著 x 軸移動元素;以及linear:動畫從頭到尾的速度是相同的 這兩個屬性值來實現;
上下的勻變速運動可以利用translatey(y):定義 2d 轉換,沿著 y 軸移動元素;以及ease-in-out:動畫以低速開始和結束。
1.html
1
<
div
id="container"
>
2<
div
class
="demobox"
>
3<
div
class
="demo"
>
div>
4div
>
5<
div
class
="demobox"
>
6<
div
class
="demo"
>
div>
7div
>
8div
>
把demobox的div做向右的勻速的運動,裡面demo的div做上下的變速的運動。
2.css
1
#container
6.demobox
13.demo
2122
.demobox:nth-of-type(1) .demo:nth-of-type(1)
25.demobox:nth-of-type(2) .demo:nth-of-type(1)
2829
@keyframes myfirst1
30 35
to 3940}
4142
@-webkit-keyframes myfirst1
/*safari and chrome
*/43
48to 52}
53@keyframes myfirst2
54 59
50%
63100% 67}
6869
@-webkit-keyframes myfirst2
/*safari and chrome
*/70
7550%
79100%
83}
ok,乙個正余弦曲線出來啦 @^-^@ css3動畫速度曲線
語法一 animation timing function value value linear 動畫從頭到尾的速度是相同的。ease 預設。動畫以低速開始,然後加快,在結束前變慢。ease in 動畫以低速開始。ease out 動畫以低速結束。ease in out 動畫以低速開始和結束。cub...
css3 動畫(二)貝塞爾曲線
有過渡效果的屬性 過渡時長 過渡函式?過渡時延 其中,1 2 以及 4 都挺好理解的,但是3是個什麼東西?其實3是 css3 中的 timing function,其中3有兩種型別的值 本篇就總結一下 cubic bezier x1,y1,x2,y2 立方貝塞爾曲線 貝塞爾曲線 bezier cur...
css動畫速度與三次貝賽爾曲線
今天要說的是css的動畫曲線。首先要說的是語法 value 1.linear 線性動畫,也就是勻速,以相同的速度開始以相同的速度結束。2.ease 預設的動畫效果,特點是先快後慢,時間為50 的時候已經完成80 的動畫效果了。3.ease in 動畫進行過程中一直加速。4.ease out 動畫進行...