Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
SWAG
css
@import "https://fonts.googleapis.com/css?family=PT+Sans+Narrow"; html, body { width: 100%; height: 100%; } body { position: relative; font-size: 12px; font-family: 'PT Sans Narrow'; background: -webkit-linear-gradient(top right, #47C9AF 0%, #D9F5BE 100%) 100% no-repeat; background: linear-gradient(to bottom left, #47C9AF 0%, #D9F5BE 100%) 100% no-repeat; } .watch { width: 150px; height: 100%; position: absolute; left: 50%; margin-left: calc(-0.5 * 150px); } .strap { background: #292929; height: 100%; width: 90px; border-left: 5px solid #4a4a4a; border-right: 5px solid #4a4a4a; position: absolute; left: 50%; margin-left: calc(-0.5 * calc(90px + 10px)); } .face { background: #292929; border: 5px solid #CDB380; width: 140px; height: 140px; position: absolute; top: 50%; margin-top: calc(-0.5 * 150px); box-shadow: 0 0 80px 0 rgba(0, 0, 0, 0.6), inset 0 0 50px 0 rgba(0, 0, 0, 0.6); } .numeral { background: #4a4a4a; height: 20px; width: 4px; } .n-12, .n-6 { position: absolute; left: 50%; margin-left: calc(-0.5 * 4px); } .n-3, .n-9 { height: 4px; width: 20px; position: absolute; top: 50%; margin-top: calc(-0.5 * 4px); } .n-12 { top: 5px; } .n-6 { bottom: 5px; } .n-3 { right: 5px; } .n-9 { left: 5px; } .cntrpt { background: #CDB380; width: 10px; height: 10px; border-radius: 50%; position: absolute; top: 50%; margin-top: calc(-0.5 * 10px); position: absolute; left: 50%; margin-left: calc(-0.5 * 10px); } .crown { background: #4a4a4a; height: 20px; width: 10px; right: -10px; position: absolute; top: 50%; margin-top: calc(-0.5 * 20px); } .hand { background: #4a4a4a; position: absolute; -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; } .hours { width: 6px; height: calc(0.2 * 140px); position: absolute; left: 50%; margin-left: calc(-0.5 * 6px); top: calc(0.5 * 140px - calc(0.2 * 140px)); } .mins { width: 4px; height: calc(0.3 * 140px); position: absolute; left: 50%; margin-left: calc(-0.5 * 4px); top: calc(0.5 * 140px - calc(0.3 * 140px)); } .secs { background: #BF4A67; width: 2px; height: calc(0.4 * 140px); position: absolute; left: 50%; margin-left: calc(-0.5 * 2px); top: calc(0.5 * 140px - calc(0.4 * 140px)); } .day { background: #292929; color: #CDB380; border: 1px solid #CDB380; width: calc(0.13 * 140px); height: calc(0.1 * 140px); line-height: calc(0.1 * 140px); text-align: center; position: absolute; top: 50%; margin-top: calc(-0.5 * calc(0.13 * 140px)); right: 28px; } .logo { color: #CDB380; width: 40px; letter-spacing: 5px; height: 12px; line-height: 12px; text-align: center; position: absolute; left: 50%; margin-left: calc(-0.5 * 40px); top: 36px; }
JavaScript
const hours = document.getElementById('hours'), mins = document.getElementById('mins'), secs = document.getElementById('secs'), day = document.getElementById('day'); let time; function getTime() { time = new Date(Date.now()); return { hours: convertToDeg(time.getHours(), 12), mins: convertToDeg(time.getMinutes(), 60), secs: convertToDeg(time.getSeconds(), 60), day: time.getDate() < 10 ? `0${time.getDate()}` : `${time.getDate()}` }; } function convertToDeg(time, factor) { return time * (360 / factor); } function setClock(time) { hours.style.transform = `rotate(${time.hours}deg)`; mins.style.transform = `rotate(${time.mins}deg)`; secs.style.transform = `rotate(${time.secs}deg)`; day.innerHTML = `${time.day}`; } setClock(getTime()); setInterval(() => { setClock(getTime()); }, 1000);
粒子
时间
文字
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号