3D 動(dòng)畫(偽3D, 真牛B)

3d變換屬性
每個(gè)屬性多了一個(gè)Z

rotate旋轉(zhuǎn)
translate 平移
perspective:2000px透視點(diǎn)
perspective-origin:25% 75%;
transform-style:preserve-3d:該聲明應(yīng)用在3d變換的兄弟元素們的父元素上,也就是舞臺(tái)元素



關(guān)鍵幀
@KEYFRAMES寫法
@-webkit-keyframes INENT{
from{Properties:properties value;}
percentage{Properties:Properties value;}
to{ Properties:properties value;}
}
animate屬性
-webkit-animation-name:”move”;動(dòng)畫屬性名,也就是我們前面keyframes定義的動(dòng)畫名
/*aninn*/
     /*-webkit-animation-name: "move";
     -o-animation-name: "move";
     animation-name: "move";*/

-webkit-anmiation-duration:10s 動(dòng)畫持續(xù)時(shí)間
/*duration 持續(xù)時(shí)間*/
/*-webkit-animation-duration: 2s;
     -o-animation-duration: 2s;
     animation-duration: 2s;*/
-webkit-anmiation-timing-function:ease-in-out:動(dòng)畫頻率 和transition-timing-function是一樣的
  /*頻率animtf*/
     /*-webkit-animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);
     -o-animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);
     animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);*/
-webkit-animation-delay:2s;動(dòng)畫延遲時(shí)間
-webkit-animation-iteration-count:10;定義循環(huán)的次數(shù),infinite為無限次
/*循環(huán)次數(shù) animic infinite 無限次循環(huán)*/
     /*-webkit-animation-iteration-count: 10;
     -o-animation-iteration-count: 10;
     animation-iteration-count: 10;*/
-webkit-animation-direction:alternate 定義動(dòng)畫輪流反向播放
/*animdi默認(rèn)返回原位置 反向執(zhí)行*/
     /*-webkit-animation-direction: alternate;
     -o-animation-direction: alternate;
     animation-direction: alternate;*/
-webkit-animation-paly-state:paused;paused暫定,running播放
  /*nfts 動(dòng)畫的播放狀態(tài) pushed暫停*/
     /*-webkit-animation-play-state: running;
     -o-animation-play-state: running;
     animation-play-state: running;*/
-webkit-animation-fill-mode:forwards:保持最后一個(gè)屬性值
/*animfm保持最后一個(gè)值*/
     /*-webkit-animation-fill-mode: forwards;
     -o-animation-fill-mode: forwards;
     animation-fill-mode: forwards;*/
         /*動(dòng)畫的名字 動(dòng)畫的時(shí)間 運(yùn)動(dòng)曲線 循環(huán)次數(shù)*/
animation
  /*動(dòng)畫的名字 動(dòng)畫的時(shí)間 運(yùn)動(dòng)曲線 循環(huán)次數(shù)*/
     -webkit-animation: "move" 2s linear 2;
     -o-animation: "move" 2s linear 2;
     animation: "move" 2s linear 2;

 <style type="text/css">
    /*關(guān)鍵幀  在css中聲明 定義動(dòng)畫*/
    @-webkit-keyframes "move"{
     0%{
      /*開始 一般省略*/
         *transform*: translateX(0); 
     }
     30%{
            *transform*: translateX(100px); 
     }
     /*60%{
      -webkit-transform: translate(50px,100px);
      -ms-transform: translate(50px,100px);
      -o-transform: translate(50px,100px);
      transform: translate(50px,100px);
     }*/
     100%{
      *transform*: translateX(0px);
     }
    }
    div{
     *width*: 100px;
     *height*: 100px;
     *background-color*: red;
     /*aninn*/
     /*-webkit-animation-name: "move";
     -o-animation-name: "move";
     animation-name: "move";*/
     /*duration 持續(xù)時(shí)間*/
     /*-webkit-animation-duration: 2s;
     -o-animation-duration: 2s;
     animation-duration: 2s;*/
        /*頻率animtf*/
     /*-webkit-animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);
     -o-animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);
     animation-timing-function: cubic-bezier(0, 1.85, 0, 0.07);*/

     /*循環(huán)次數(shù) animic infinite 無限次循環(huán)*/
     /*-webkit-animation-iteration-count: 10;
     -o-animation-iteration-count: 10;
     animation-iteration-count: 10;*/
        /*animdi默認(rèn)返回原位置 反向執(zhí)行*/
     /*-webkit-animation-direction: alternate;
     -o-animation-direction: alternate;
     animation-direction: alternate;*/
        /*nfts 動(dòng)畫的播放狀態(tài) pushed暫停*/
     /*-webkit-animation-play-state: running;
     -o-animation-play-state: running;
     animation-play-state: running;*/

     /*animfm保持最后一個(gè)值*/
     /*-webkit-animation-fill-mode: forwards;
     -o-animation-fill-mode: forwards;
     animation-fill-mode: forwards;*/
         /*動(dòng)畫的名字 動(dòng)畫的時(shí)間 運(yùn)動(dòng)曲線 循環(huán)次數(shù)*/
     *-webkit-animation*: "move" 2s *linear *2;
     -o-animation: "move" 2s *linear *2;
     *animation*: "move" 2s *linear *2;
    }
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 關(guān)于css3變形 CSS3變形是一些效果的集合,比如平移、旋轉(zhuǎn)、縮放和傾斜效果,每個(gè)效果都被稱作為變形函數(shù)(Tra...
    hopevow閱讀 6,564評(píng)論 2 13
  • 看了很多視頻、文章,最后卻通通忘記了,別人的知識(shí)依舊是別人的,自己卻什么都沒獲得。此系列文章旨在加深自己的印象,因...
    DCbryant閱讀 1,963評(píng)論 0 4
  • CSS的變形對(duì)應(yīng)的屬性是transform,它的作用是修改元素自身的坐標(biāo)空間。這個(gè)修改實(shí)際對(duì)應(yīng)了一個(gè)坐標(biāo)系統(tǒng)映射轉(zhuǎn)...
    荷小音閱讀 1,203評(píng)論 1 5
  • >*很不幸,沒人能告訴你母體是什么,你只能自己體會(huì)* --駭客帝國(guó) 在第四章“可視效果”中,我們研究了一些增強(qiáng)圖層...
    夜空下最亮的亮點(diǎn)閱讀 1,721評(píng)論 0 2
  • CSS里transform變形這個(gè)屬性有點(diǎn)學(xué)習(xí)難度,尤其在CSS3里加上了3D效果之后,2維變3維學(xué)習(xí)成本更是成倍...
    張歆琳閱讀 28,362評(píng)論 5 81

友情鏈接更多精彩內(nèi)容