canvas时钟

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin:;
padding:;
}
html,body{
background:#;
}
#c1{
background:#fff;
}
</style>
<script>
window.onload=function(){
var oC=document.getElementById('c1');
var gd=oC.getContext('2d');
function toDraw(){
var x=;
var y=;
var r=;
var oDate= new Date();
var h=oDate.getHours();
var m=oDate.getMinutes();
var s=oDate.getSeconds();
var ms=oDate.getMilliseconds();
console.log(ms);
gd.clearRect(,,oC.width,oC.height);
for(var i=;i<;i++){
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r,i**Math.PI/,(i+)**Math.PI/,false);
gd.closePath();
gd.stroke();
}
gd.fillStyle='#fff';
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r*/,,*Math.PI/,false);
gd.closePath();
gd.fill();
for(var i=;i<;i++){
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r,i**Math.PI/,(i+)**Math.PI/,false);
gd.closePath();
gd.stroke();
}
gd.fillStyle='#fff';
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r*/,,*Math.PI/,false);
gd.closePath();
gd.fill(); gd.lineWidth=;
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r*/,(-+h*+m/)*Math.PI/,(-+h*+m/)*Math.PI/,false);
gd.closePath();
gd.stroke(); gd.lineWidth=;
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r*/,(-+m*+s/)*Math.PI/,(-+m*+s/)*Math.PI/,false);
gd.closePath();
gd.stroke();
gd.lineWidth=;
gd.beginPath();
gd.moveTo(x,y);
gd.arc(x,y,r*/,(-+s*+ms*/)*Math.PI/,(-+s*+ms*/)*Math.PI/,false);
gd.closePath();
gd.stroke();
}
toDraw();
setInterval(toDraw,)
};
</script>
</head>
<body>
<canvas width="" height="" id="c1"></canvas>
</body>
</html>
上一篇:left join,right join,inner join,full join之间的区别


下一篇:[Oracle] Oracle和SQLServer的数据类型比较