css3实现一个环形倒计时效果代码
代码语言:html
所属分类:布局界面
代码描述:css3实现一个环形倒计时效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html> <head> <meta charset="utf-8"> <style> @import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400); * { box-sizing: border-box; } html { background: #111 ; color: #fff; font-family: 'Yanone Kaffeesatz', sans-serif; } body { padding: 20px; } .timer-group { height: 400px; margin: 0 auto; position: relative; width: 400px; } .timer { border-radius: 50%; height: 100px; overflow: hidden; position: absolute; width: 100px; } .timer:after { background: #111; border-radius: 50%; content: ""; display: block; height: 80px; left: 10px; position: absolute; width: 80px; top: 10px; } .timer .hand { float: left; height: 100%; overflow: hidden; position: relative; width: 50%; } .timer .hand span { border: 50px solid rgba(0, 255, 255, .4); border-bottom-color: transparent; border-left-color: transparent; border-radius: 50%; display: block; height: 0; position: absolute; right: 0; top: 0; transform: rotate(225deg); width: 0; } .timer .hand:first-child { transform: rotate(180deg); } .timer .hand span { animation-duration: 4s; animation-iteration-count: infinite; animation-timing-function: linear; } .timer .hand:first-child span { animation-name: spin1; } .timer .hand:last-child span { animation-name: spin2; } .timer.hour { background: rgba(0, 0, 0, .3); height: 400px; left: 0; width: 400px; top: 0; } .timer.hour .hand span { animation-duration: 3600s; border-top-color: rgba(255, 0, 255, .4); border-right-color: rgba(255, 0, 255, .4); border-width: 200px; } .timer.hour:after { height: 360px; left: 20px; width: 360px; top: 20px; } .timer.minute {.........完整代码请登录后点击上方下载按钮下载查看
网友评论0