Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
A CSS Chronograph
00:00:00
css
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400); * { box-sizing: border-box; } html { background: #111 url(http://codepen.io/images/classy_fabric.png); 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 url(http://codepen.io/images/classy_fabric.png); 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 { background: rgba(0, 0, 0, .2); height: 350px; left: 25px; width: 350px; top: 25px; } .timer.minute .hand span { animation-duration: 60s; border-top-color: rgba(0, 255, 255, .4); border-right-color: rgba(0, 255, 255, .4); border-width: 175px; } .timer.minute:after { height: 310px; left: 20px; width: 310px; top: 20px; } .timer.second { background: rgba(0, 0, 0, .2); height: 300px; left: 50px; width: 300px; top: 50px; } .timer.second .hand span { animation-duration: 1s; border-top-color: rgba(255, 255, 255, .15); border-right-color: rgba(255, 255, 255, .15); border-width: 150px; } .timer.second:after { height: 296px; left: 2px; width: 296px; top: 2px; } .face { background: rgba(0, 0, 0, .1); border-radius: 50%; height: 296px; left: 52px; padding: 165px 40px 0; position: absolute; width: 296px; text-align: center; top: 52px; } .face h2 { font-weight: 300; } .face p { border-radius: 20px; font-size: 76px; font-weight: 400; position: absolute; top: 17px; width: 260px; left: 20px; } @keyframes spin1 { 0% { transform: rotate(225deg); } 50% { transform: rotate(225deg); } 100% { transform: rotate(405deg); } } @keyframes spin2 { 0% { transform: rotate(225deg); } 50% { transform: rotate(405deg); } 100% { transform: rotate(405deg); } }
JavaScript
var defaults = {} , one_second = 1000 , one_minute = one_second * 60 , one_hour = one_minute * 60 , one_day = one_hour * 24 , startDate = new Date() , face = document.getElementById('lazy'); // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ var requestAnimationFrame = (function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function( callback ){ window.setTimeout(callback, 1000 / 60); }; }()); tick(); function tick() { var now = new Date() , elapsed = now - startDate , parts = []; parts[0] = '' + Math.floor( elapsed / one_hour ); parts[1] = '' + Math.floor( (elapsed % one_hour) / one_minute ); parts[2] = '' + Math.floor( ( (elapsed % one_hour) % one_minute ) / one_second ); parts[0] = (parts[0].length == 1) ? '0' + parts[0] : parts[0]; parts[1] = (parts[1].length == 1) ? '0' + parts[1] : parts[1]; parts[2] = (parts[2].length == 1) ? '0' + parts[2] : parts[2]; face.innerText = parts.join(':'); requestAnimationFrame(tick); }
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>CSS计时器-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号