Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
@font-face { font-family:unidreamLED; src:url('./UnidreamLED.ttf') /* src:url("./UnidreamLED.ttf"); */ } body { font-size:0px; height:100%; width:100%; padding:0; margin:0; position:absolute; display:flex; justify-content:center; align-items:center; color:#cad6dd; overflow:hidden; background-color:#141929; font-family:unidreamLED; } .NowData { background-image:-webkit-linear-gradient(bottom,rgb(255 0 0),rgb(120 8 220)); background-size:100% 20px; -webkit-background-clip:text; -webkit-text-fill-color:transparent; } .yearBox { height:10vh; width:10vh; position:absolute; display:flex; font-size:16px; align-items:center; justify-content:center; border-radius:50%; transition:1s; background-image:-webkit-linear-gradient(bottom,rgb(255 0 0),rgb(120 8 220)); background-size:100% 20px; -webkit-background-clip:text; -webkit-text-fill-color:transparent; } .mounthBox { height:25vh; width:25vh; position:absolute; display:flex; align-items:center; border-radius:50%; transition:1s; } .dayBox { height:40vh; width:40vh; border-radius:50%; display:flex; align-items:center; position:absolute; transition:1s; } .hourBox { height:55vh; width:55vh; position:absolute; display:flex; align-items:center; transition:1s; border-radius:50%; } .minuteBox { height:70vh; width:70vh; position:absolute; display:flex; align-items:center; border-radius:50%; transition:1s; } .secondBox { height:85vh; width:85vh; display:flex; align-items:center; position:absolute; border-radius:50%; transition:1s; }
JavaScript
let sencond = `` for (i = 0; i < 60; i++) { let onediv = `
${i+1} 秒
` sencond = sencond + onediv } document.querySelector('.secondBox').innerHTML = sencond let minute = `` for (i = 0; i < 60; i++) { let onediv = `
${i+1} 分
` minute = minute + onediv } document.querySelector('.minuteBox').innerHTML = minute let hour = `` for (i = 0; i < 24; i++) { let onediv = `
${i+1} 时
` hour = hour + onediv } document.querySelector('.hourBox').innerHTML = hour let day = `` for (i = 0; i < 31; i++) { let onediv = `
${i+1} 日
` day = day + onediv } document.querySelector('.dayBox').innerHTML = day let mounth = `` for (i = 0; i < 12; i++) { let onediv = `
${i+1} 月
` mounth = mounth + onediv } document.querySelector('.mounthBox').innerHTML = mounth var sencond360 = 0 var Minute360 = 0 var hour360 = 0 var day360 = 0 var mounth360 = 0 var oldsencond = 0 var oldMinute = 0 var oldhour = 0 var oldday = 0 var oldmounth = 0 function transformBox() { let nowDate = new Date() let sencond = nowDate.getSeconds() let minute = nowDate.getMinutes() let hour = nowDate.getHours() let day = nowDate.getDate() let mounth = nowDate.getMonth() let year = nowDate.getFullYear() if (sencond === 0 && oldsencond !== sencond) { sencond360 = sencond360 + 1 } if (minute === 0 && oldMinute !== minute) { Minute360 = Minute360 + 1 } if (hour === 0 && oldhour !== hour) { hour360 = hour360 + 1 } if (day === 1 && oldday !== day) { day360 = day360 + 1 } if (mounth === 0 && oldmounth !== mounth) { mounth360 = mounth360 + 1 } document.querySelector('.secondBox').style.transform = `rotate(${sencond360*360 + (sencond-1)*6}deg)` document.querySelector('.minuteBox').style.transform = `rotate(${Minute360*360 + (minute-1)*6}deg)` document.querySelector('.hourBox').style.transform = `rotate(${hour360*360 + (hour-1)*15}deg)` document.querySelector('.dayBox').style.transform = `rotate(${day360*360 + (day-1)*11.25}deg)` document.querySelector('.mounthBox').style.transform = `rotate(${mounth360*360 + (mounth)*30}deg)` document.querySelector('.yearBox').innerHTML = year + ' 年' let nowDates = document.querySelectorAll('.NowData') nowDates.forEach(element => { element.classList = '' }); document.querySelector(`#sencond${sencond+1}`).classList = 'NowData' document.querySelector(`#minute${minute===0?'60':minute}`).classList = 'NowData' document.querySelector(`#hour${hour===0?'24':hour}`).classList = 'NowData' document.querySelector(`#day${day}`).classList = 'NowData' document.querySelector(`#mounth${mounth+1}`).classList = 'NowData' oldsencond = sencond oldMinute = minute oldhour = hour oldday = day oldmounth = mounth } transformBox() setInterval(() => { transformBox() }, 1000);
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>js罗盘时钟-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号