Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body{ margin: 0; padding: 0; background: #333; } canvas{ position: absolute; top: -webkit-calc(50% - 250px); top: calc(50% - 250px); left: -webkit-calc(50% - 300px); left: calc(50% - 300px); } div{ position: absolute; top: 5px; left: 5px; color: #fff; font-size: 40px; font-family: Arial; } span{ position: absolute; bottom: 5px; left: 5px; color: #666; font-size: 13px; font-family: Arial; } span a{ text-decoration: none; color: #0579f5; }
JavaScript
var usr_color = 160; //Change value to change color scheme window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function( callback ){ window.setTimeout(callback, 1000 / 60); }; })(); var canvas = document.getElementsByTagName("canvas")[0]; var ctx = canvas.getContext("2d"); var w = 600, h = 600; canvas.width = w; canvas.height = h; var arcs = []; function init(){ console.log("init called"); reset(); arcs = []; var m = new arc(); m.class = "month"; arcs.push(m); var d = new arc(); d.class = "date"; d.r = 135; arcs.push(d); var d = new arc(); d.class = "day"; d.r = 170; arcs.push(d); var h = new arc(); h.class = "hours"; h.r = 205; arcs.push(h); var m = new arc(); m.class = "mins"; m.r = 240; arcs.push(m); var s = new arc(); s.class = "secs"; s.r = 275; arcs.push(s); } function arc(){ this.class = "month"; this.r = 100; this.rot = 1; this.draw = function(){ ctx.beginPath(); ctx.arc(300,300,this.r,(Math.PI/(2/3)),this.rot,false); ctx.lineWidth = 30; ctx.strokeStyle = "hsla("+(this.rot*(180/Math.PI)+usr_color)+",60%,50%,1)"; ctx.stroke(); ctx.save(); ctx.fillStyle = "#333"; ctx.translate(300, 300); ctx.rotate(this.rot); ctx.font="14px Arial Rounded MT Bold"; if(this.class == "secs"){ var d = new Date(); ctx.fillText(d.getSeconds(), 267, -5); } else if(this.class == "mins"){ var d = new Date(); ctx.fillText(d.getMinutes(), 233, -5); } else if(this.class == "hours"){ var d = new Date(); ctx.fillText(d.getHours(), 197, -5); } else if(this.class == "day"){ var d = new Date(); var day = d.getDay(); if(day == 1){ var day = "Mon" } else if(day == 2){ var day = "Tue" } else if(day == 3){ var day = "Wed" } else if(day == 4){ var day = "Thu" } else if(day == 5){ var day = "Fri" } else if(day == 6){ var day = "Sat" } else if(day == 7){ var day = "Sun" } ctx.fillText(day, 158, -5); } else if(this.class == "date"){ var d = new Date(); ctx.fillText(d.getDate(), 127, -5); } else if(this.class == "month"){ var d = new Date(); ctx.fillText(d.getMonth()+1, 97, -5); } ctx.restore(); } } function reset(){ ctx.fillStyle = "#333"; ctx.fillRect(0,0,w,h); } function draw(){ reset(); ctx.fillStyle = "rgba(255,255,255,0.5)"; ctx.font = "12px Arial" ctx.fillText("seconds", 250, 27); ctx.fillText("minutes", 252, 63); ctx.fillText("hours", 264, 98); ctx.fillText("day", 274, 134); ctx.fillText("date", 270, 168); ctx.fillText("month", 260, 203); for(var i=0;i
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>HTML5极地时钟-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号