css3動畫-animation之rotate

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   使用   io   ar   for   

/* Timer*/

.timer{ width: 240px; height: 240px; background-color: transparent; box-shadow: inset 0px 0px 0px 2px #fff; border: 2px #f00 solid; border-radius: 50%; position: relative; margin: 38px auto; }

.timer:after, .timer:before{ position: absolute; content:""; background-color: #fff; }

.timer:after{ width: 10px; height: 2px; top: 11px; left: 11px; -webkit-transform-origin: 1px 1px; -moz-transform-origin: 1px 1px; transform-origin: 1px 1px; -webkit-animation: minhand 2s linear infinite; -moz-animation: minhand 2s linear infinite; animation: minhand 2s linear infinite; }

.timer:before{ width: 8px; height: 2px; top: 11px; left: 11px; -webkit-transform-origin: 1px 1px; -moz-transform-origin: 1px 1px; transform-origin: 1px 1px; -webkit-animation: hrhand 8s linear infinite; -moz-animation: hrhand 8s linear infinite; animation: hrhand 8s linear infinite; }

span.s1 {  position: absolute;  top:120px;  left:120px;  width: 60px;  border-top: 2px #0f0 solid;  -webkit-transform-origin: left top;  -webkit-transition-delay: 0;  -webkit-animation: minhand 3s linear infinite; }

span.s2 {  position: absolute;  top:120px;  left:120px;  width: 0px;  height: 80px;  border-left: 2px #00f solid;  -webkit-transform-origin: left top;  -webkit-transition-delay: 0;  -webkit-animation: hrhand 1s linear infinite; }

span.s3 {  position: absolute;  width: 6px;  height: 6px;  top: 117px;  left: 117px;  background: #000;  border-radius: 3px;  text-align: center;  vertical-align: middle; }

 

@-webkit-keyframes minhand{

0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(360deg)} } @-moz-keyframes minhand{ 0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(360deg)} } @keyframes minhand{ 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

@-webkit-keyframes hrhand{ 0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(360deg)} } @-moz-keyframes hrhand{ 0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(360deg)} } @keyframes hrhand{ 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

 

 

 

 

 

<!-- 時間 -->

<div class="timer">  

  <span class="s1"></span>

   <span class="s2"></span>

   <span class="s3"></span>

</div>

 **************

2D Transform 方法

 

函數 描述
matrix(n,n,n,n,n,n) 定義 2D 轉換,使用六個值的矩陣。
translate(x,y) 定義 2D 轉換,沿著 X 和 Y 軸移動元素。
translateX(n) 定義 2D 轉換,沿著 X 軸移動元素。
translateY(n) 定義 2D 轉換,沿著 Y 軸移動元素。
scale(x,y) 定義 2D 縮放轉換,改變元素的寬度和高度。
scaleX(n) 定義 2D 縮放轉換,改變元素的寬度。
scaleY(n) 定義 2D 縮放轉換,改變元素的高度。
rotate(angle) 定義 2D 旋轉,在參數中規定角度。
skew(x-angle,y-angle) 定義 2D 傾斜轉換,沿著 X 和 Y 軸。
skewX(angle) 定義 2D 傾斜轉換,沿著 X 軸。
skewY(angle) 定義 2D 傾斜轉換,沿著 Y 軸。

 

css3動畫-animation之rotate

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.