CSS3紙飛機程式碼例項
分享一段程式碼例項,它利用css3實現了紙飛機效果,並且紙飛機能夠飛行一定的距離。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼執行程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style type="text/css"> * { margin: 0; padding: 0; } body { background: #f0ffff; } .airplane { width: auto; height: auto; position: absolute; top: 0; left: 0; -webkit-animation: move_plane 2s ease forwards; cursor: pointer; } @keyframes move_plane { 100% { left: 500px; top: 200px; } } @keyframes move_top { 100% { border-bottom: 100px solid #28935d; border-left: 170px solid transparent; border-right: 130px solid transparent; } } @keyframes move_af_top { 100% { opacity: 1; } } @keyframes move_mid { 100% { top: 200px; left: 171px; border-top: 130px solid #28935d; border-left: 174px solid transparent; border-right: 110px solid transparent; -webkit-transform: rotate(-66.3deg); } } @keyframes move_bot { 100% { left: 50px; top: 150px; -webkit-transform: rotate(-66.2deg) rotateX(180deg); border-top: 130px solid #28935d; border-left: 100px solid transparent; border-right: 185px solid transparent; } } @keyframes hid_warp { 80% { -webkit-transform: rotate(30deg) translateY(-200px); } 100% { opacity: 0; } } @keyframes show_message { 100% { opacity: 1; } } .top { width: 0; height: 0; position: absolute; top: 0; left: 0; left: 15px; display: block; border-bottom: 30px solid #000; border-left: 75px solid transparent; border-right: 225px solid transparent; -webkit-transform: rotate(4deg); } .after_top { width: 0px; height: 0px; position: absolute; top: 100px; left: 2px; opacity: 0; border-top: 130px solid #2bb673; border-left: 118px solid transparent; border-right: 185px solid transparent; -webkit-transform: rotate(4deg); } .mid { width: 0; height: 0; position: absolute; top: 40px; left: 0px; display: block; z-index: 11; border-top: 80px solid #28935d; border-left: 15px solid transparent; border-right: 300px solid transparent; } .bot { width: 0; height: 0; position: absolute; top: 40px; left: 0px; display: block; border-top: 110px solid #2bb673; border-left: 95px solid transparent; border-right: 220px solid transparent; } .message { width: 220px; height: 350px; background: #2bb673; position: absolute; top: 100px; left: 600px; opacity: 0; text-align: center; } </style> </head> <body> <div class="airplane"> <div class="top"></div> <div class="after_top"></div> <div class="mid"></div> <div class="bot"></div> </div> </body> </html>
相關文章
- CSS3卡通形象程式碼例項CSSS3
- css3水滴效果程式碼例項CSSS3
- css3晃動效果程式碼例項CSSS3
- CSS3心形效果程式碼例項CSSS3
- CSS3發光背景程式碼例項CSSS3
- CSS3旋轉效果程式碼例項CSSS3
- CSS3滑過光束效果程式碼例項CSSS3
- CSS3小黃人效果程式碼例項CSSS3
- CSS3圖層陰影程式碼例項CSSS3
- css3折角效果程式碼例項CSSS3
- CSS3梯形效果程式碼例項CSSS3
- CSS3背景漸變效果程式碼例項CSSS3
- CSS3星系運動效果程式碼例項CSSS3
- CSS3文字凹凸效果程式碼例項CSSS3
- CSS3文字陰影效果程式碼例項CSSS3
- CSS3立體導航選單程式碼例項CSSS3
- CSS3 Flex 彈性佈局例項程式碼詳解CSSS3Flex
- CSS3繪製太極圖程式碼例項詳解CSSS3
- CSS3 translate導致字型模糊的例項程式碼CSSS3
- canvas繪製機器貓程式碼例項Canvas
- dom操作程式碼例項
- css梯形程式碼例項CSS
- 前端學習程式碼例項-JavaScript 生成隨機數前端JavaScript隨機
- JavaScript in運算子程式碼例項JavaScript
- 設計模式例項程式碼設計模式
- table表格美化程式碼例項
- 純css tab選項卡程式碼例項CSS
- jQuery tab選項卡效果程式碼例項jQuery
- canvas刮刮樂程式碼例項Canvas
- canvas載入效果程式碼例項Canvas
- CSS空心箭頭程式碼例項CSS
- JavaScript運動框架程式碼例項JavaScript框架
- jQuery.map()方法程式碼例項jQuery
- CSS橢圓效果程式碼例項CSS
- CSS條紋背景程式碼例項CSS
- flex居中佈局程式碼例項Flex
- JavaScript取餘數程式碼例項JavaScript
- canvas繪製扇形程式碼例項Canvas