读书人

世界下最短的时钟代码!更短的有木有

发布时间: 2012-09-16 17:33:17 作者: rapoo

世界上最短的时钟代码!更短的,有木有?

复制内容到剪贴板

    复制内容到剪贴板
      复制内容到剪贴板
      1. 01 <!DOCTYPE html>
      2. <html> <head>
      3. <body> <script src="http://files.cnblogs.com/iamzhanglei/processing.js" type="text/javascript"></script>
      4. <script type="application/processing"> void draw() {
      5. size(200, 200);background(0); fill(80); noStroke(); ellipse(100, 100, 160, 160); stroke(255); line(100, 100, cos( TWO_PI*second()/60- HALF_PI) * 70 + 100, sin(TWO_PI*second()/60- HALF_PI) * 70 + 100);
      6. line(100, 100, cos( TWO_PI*minute()/60- HALF_PI) * 60 + 100, sin(TWO_PI*minute()/60- HALF_PI) * 60 + 100); line(100, 100, cos(TWO_PI*(hour()%12)/12- HALF_PI) * 50 + 100, sin(TWO_PI*(hour()%12)/12- HALF_PI) * 50 + 100);
      7. } </script>
      8. <canvas>你的浏览器不支持HTML5,请使用谷歌、IE9或者火狐浏览器</canvas> </body>
      9. </html>

读书人网 >编程

热点推荐