可控制轉速CSS3旋轉風車特效
以前製作網頁動畫一般使用javascript,現在已經有越來越多動動畫使用純CSS實現,並且動畫的控制也可以使用CSS3實現,因為CSS 3來了,CSS 3的動畫功能確實強大。以下是一個純CSS3製作的風車旋轉動畫,而且也用CSS 3控制速度。
體驗效果:
http://hovertree.com/texiao/css3/40/
效果圖:
##可以看到,風車的葉片是三角形,使用css畫出各種圖形請參考:
http://hovertree.com/h/bjaf/jtkqnsc1.htm
#http://hovertree.com/h/bjaf/ltgc20vn.htm
css製作動畫是用到了animation屬性,請參考:
#http:/ /hovertree.com/h/bjaf/i309b77d.htm
#http://hovertree.com/h/bjaf/fwck53gt.htm
#http://hovertree.com/h/bjaf/xpxgjfap.htm
#http://hovertree.com/h/bjaf/kqud99m6.htm
#扇葉的旋轉使用到了transform屬性,參考:
http://hovertree.com/h/bjaf/c3bshswk.htm
http:// hovertree.com/h/bjaf/lxsexx3m.htm
本範例用到了CSS 3的選擇器nth-of-type,參考:
http://hovertree.com /h/bjaf/c2c0k0tf.htm
<!DOCTYPE html><html lang="zh-CN"> <head><meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>可控制转速CSS3旋转风车特效 - 何问起</title> <link rel="stylesheet" href="http://hovertree.com/texiao/css3/40/style/hovertreespin.css"> </head><body><p class="wrapper"> <p class="pin-layout"> <a href="#" class="control">暂停</a> <a href="#" class="control">旋转</a> <a href="#" class="control">中速</a> <a href="#" class="control">高速</a> <p class="pillar"> <p class="dot"></p> <span class="item1"></span> <span class="item2"></span> <span class="item3"></span> <span class="item4"></span> </p> </p> <p><b>何问起温馨小提示:</b>暂停后点击页面任何区域都可自动旋转哦!</p></p><!-- end wrapper --><p style="text-align:center;margin:100px 0; font:normal 14px/24px 'MicroSoft YaHei';"><p>适用于支持CSS3的浏览器。</p><p>来源:<a href="http://hovertree.com/" target="_blank">何问起</a> <a href="http://hovertree.com/h/bjag/efqb2w4s.htm" target="_blank">说明</a></p></p></body></html>
*{margin:0; padding:0;}body{background:#eee;width:100%; height:100%;}.wrapper{ position: relative; width: 800px; height:450px; margin:60px auto 0; }.wrapper .pin-layout{ position: absolute; bottom: 0; left: calc(50% - 20px); width:40px; height:280px; }.wrapper .pin-layout::after{ position:absolute; bottom:0; left: calc(50% - 20px); content:""; height:0; width:10px; border-width: 0px 15px 280px 15px; border-style:solid; border-color:transparent transparent #6B3500 transparent; }.wrapper .pin-layout .pillar{ position: absolute; top: -18px; left: calc(50% - 18px); width:36px; height:36px; z-index: 9; transform: rotateZ(45deg); transition:all .9s linear; animation: hovertreespin 3s linear 0s infinite; }.pin-layout .control:hover::after{ position: absolute; left: 0; content: ""; width: 100%; height:100%; background: rgba(0,0,0,.3); }.pin-layout .control{ position: absolute; bottom:0; width: 80px; height:30px; line-height:30px; border: 1px solid #ADADAD; border-radius: 4px; text-align:center; text-decoration:none; letter-spacing:2px; color: white; background: red; }.pin-layout .control:nth-of-type(1){ left: -100px; }.pin-layout .control:nth-of-type(3):focus ~ .pillar{ animation-duration:.8s; }.pin-layout .control:nth-of-type(4):focus ~ .pillar{ animation-duration:.2s; }.pin-layout .control:nth-of-type(2){ right: -100px; background: green; }.pin-layout .control:nth-of-type(3){ bottom: -40px; left: -100px; background: #037862; }.pin-layout .control:nth-of-type(4){ bottom: -40px; right: -100px; background: #036B3E; }.pin-layout .control:nth-of-type(1):focus ~ .pillar{ animation-play-state:paused; }.pin-layout .control:nth-of-type(2):focus ~ .pillar{ animation-play-state:running; } .pin-layout .pillar span[class^="item"]{ position: absolute; top: calc(-200px + 18px); left: 18px; border-width:0px 80px 200px 0px; border-style:solid; } .pin-layout .pillar span[class^="item"]:nth-of-type(1){ z-index:1; border-color:transparent transparent dodgerblue transparent; /*border-color:green red gray blue;*/} .pin-layout .pillar span[class^="item"]:nth-of-type(2){ z-index:2; border-color:transparent transparent orangered transparent; transform-origin:left bottom; transform: rotateZ(90deg); } .pin-layout .pillar span[class^="item"]:nth-of-type(3){ z-index:3; border-color:transparent transparent greenyellow transparent; transform-origin:left bottom; transform: rotateZ(180deg); } .pin-layout .pillar span[class^="item"]:nth-of-type(4){ z-index:4; border-color:transparent transparent mediumpurple transparent; transform-origin:left bottom; transform: rotateZ(270deg); }.wrapper .pin-layout .pillar .dot{ position: absolute; top: 0; left: 0; border-width: 19px; border-style: solid; border-color: #3C0505 transparent #3C0505 transparent; border-radius:50%; background:#F505EE; z-index:1999; box-shadow:0 0 2px #1A0505; }@keyframes hovertreespin { 0%{ transform: rotate(0deg) } 100%{ transform:rotate(360deg); }}

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

純CSS3怎麼實現波浪效果?這篇文章就來跟大家介紹一下使用 SVG 和 CSS 動畫來製作波浪效果的方法,希望對大家有幫助!

兩種方法:1、利用display屬性,只要為元素加上「display:none;」樣式即可。 2.利用position和top屬性設定元素絕對定位來隱藏元素,只需為元素加上「position:absolute;top:-9999px;」樣式。

在css中,可以利用border-image屬性來實作花邊邊框。 border-image屬性可以使用圖片來建立邊框,即給邊框加上背景圖片,只需要將背景圖片指定為花邊樣式即可;語法「border-image: url(圖片路徑) 向內偏移值圖像邊界寬度outset 是否重複;」。

實作方法:1、使用「:active」選擇器選取滑鼠點擊圖片的狀態;2、使用transform屬性和scale()函數實現圖片放大效果,語法「img:active {transform: scale(x軸放大倍率,y軸放大倍率);}」。

怎麼製作文字輪播與圖片輪播?大家第一想到的是利用js,其實利用純CSS也能實現文字輪播與圖片輪播,下面來看看實作方法,希望對大家有幫助!

在css3中,可以利用「animation-timing-function」屬性來設定動畫旋轉速度,該屬性用於指定動畫將如何完成一個週期,設定動畫的速度曲線,語法為「元素{animation-timing-function:速度屬性值;}」。

css3中的動畫效果有變形;可以利用「animation:動畫屬性@keyframes ..{..{transform:變形屬性}}」實現變形動畫效果,animation屬性用於設定動畫樣式,transform屬性用於設定變形樣式。
