Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body { background-color: #74c4c8; margin: 0; } .wrapper { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .face { display: flex; justify-content: center; align-items: center; width: 70vmin; height: 70vmin; border-radius: 50%; position: relative; background: radial-gradient(ellipse at center, #ec7277, #ec7277 60%, #e1ecde calc( 60% + 1px ), #e1ecde 63%, #079554 calc( 63% + 1px ), #079554 68%, #056e3e calc( 68% + 1px )); box-shadow: -0.3vmin -0.3vmin 0.1vmin #e1ecde, 3vmin 3vmin 0.1vmin #44a7ac; } .face:after { content: ''; display: block; width: 3.5vmin; height: 3.5vmin; border-radius: 50%; background-color: #f8ccce; position: absolute; } .quarter { height: 80%; width: 80%; position: absolute; } .quarter div { height: 10%; width: 2.4%; border-radius: 1vmin; background-color: #c41a21; position: absolute; } .quarter div:nth-child(even) { top: 45%; transform: rotate(90deg); } .quarter div:nth-child(odd) { left: 48.8%; } .quarter div:nth-child(1) { top: 0; } .quarter div:nth-child(2) { right: 3%; } .quarter div:nth-child(3) { bottom: 0; } .quarter div:nth-child(4) { left: 3%; } .seeds { width: 85%; height: 85%; border-radius: 50%; overflow: hidden; position: relative; } .seeds div { display: block; height: 3.5vmin; width: 2vmin; background-color: #e32f36; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; position: absolute; } .seeds div:nth-child(1) { top: 62%; left: 6%; transform: rotate(296deg); } .seeds div:nth-child(2) { top: 55%; left: 12%; transform: rotate(166deg); } .seeds div:nth-child(3) { top: 56%; left: 18%; transform: rotate(226deg); } .seeds div:nth-child(4) { top: 16%; left: 24%; transform: rotate(285deg); } .seeds div:nth-child(5) { top: 9%; left: 30%; transform: rotate(277deg); } .seeds div:nth-child(6) { top: 76%; left: 36%; transform: rotate(266deg); } .seeds div:nth-child(7) { top: 40%; left: 42%; transform: rotate(100deg); } .seeds div:nth-child(8) { top: 58%; left: 48%; transform: rotate(52deg); } .seeds div:nth-child(9) { top: 49%; left: 54%; transform: rotate(168deg); } .seeds div:nth-child(10) { top: 16%; left: 60%; transform: rotate(154deg); } .seeds div:nth-child(11) { top: 81%; left: 66%; transform: rotate(234deg); } .seeds div:nth-child(12) { top: 44%; left: 72%; transform: rotate(224deg); } .seeds div:nth-child(13) { top: 38%; left: 78%; transform: rotate(132deg); } .seeds div:nth-child(14) { top: 40%; left: 84%; transform: rotate(111deg); } .seeds div:nth-child(15) { top: 9%; left: 90%; transform: rotate(53deg); } .hands div { position: absolute; bottom: 50%; border-radius: 1vmin; transform-origin: 50% 100%; transform: rotate(0); } .hands div.h { height: 27%; width: 2.4%; left: 48.8%; background-color: #6f0f13; } .hands div.m { height: 40%; width: 2.4%; left: 48.8%; background-color: #a0161b; } .hands div.s { height: 50%; width: 1%; left: 49.5%; bottom: 40%; transform-origin: 50% 80%; background-color: #f8ccce; }
JavaScript
const sHand = document.querySelector('.s'); const mHand = document.querySelector('.m'); const hHand = document.querySelector('.h'); function setTime() { const d = new Date(); const s = d.getSeconds(); const m = d.getMinutes(); const h = d.getHours(); const sDeg = (( s / 60 ) * 360 ); const mDeg = (( m / 60 ) * 360 ); const hDeg = (( h / 12 ) * 360 ); sHand.style.transform = `rotate( ${sDeg}deg )`; mHand.style.transform = `rotate( ${mDeg}deg )`; hHand.style.transform = `rotate( ${hDeg}deg )`; } setInterval( setTime, 1000 );
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>西瓜时钟-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号