超级绚丽的html5的页面

XML/HTML Code 复制内容到剪贴板 !DOCTYPEhtml html xmlns =http://www.w3.org/1999/xhtml lang =en head title 超级绚丽的html5的页面 / title script type =text/javascript window.onload = function (){ C = Math .cos; S = Math .sin; U…

 

XML/HTML Code 复制内容到剪贴板
  1.  <!DOCTYPE html>  
  2. <html xmlns=”http://www.w3.org/1999/xhtml” lang=”en”>  
  3.   
  4. <head>  
  5.   
  6. <title>超级绚丽的html5的页面</title>  
  7.   
  8. <script type=”text/javascript”>  
  9.   
  10. window.onload = function () {  
  11. C = Math.cos;  
  12. S = Math.sin;  
  13. U = 0;  
  14. canvas = document.getElementById(“myCanvas”);  
  15. c = canvas.getContext(“2d”);  
  16. var W = canvas.width = window.innerWidth;  
  17. var H =>http://www.0771ybyy.com/news/1799.html< canvas.height = window.innerHeight;  
  18. c.fillRect(0, 0, W, H); // resize <canvas> and draw black rect (default)  
  19. c.globalCompositeOperation = “lighter”; // switch to additive color application  
  20. c.lineWidth = 0.2;//设置画笔的大小  
  21. c.lineCap = “round”;//设置圆滑  
  22. var bool = 0,  
  23. t = 0; // theta  
  24.   
  25. canvas.onmousemove = function (e) {  
  26. if(window.T) >http://www.0771ybyy.com/news/1801.html<{  
  27. if(D==9) {  
  28. D=Math.random()*15; f(1); }  
  29. clearTimeout(T);  
  30. }  
  31. X = e.pageX; // grab mouse pixel coords  
  32. Y = e.pageY;  
  33. a=0; // previous coord.x  
  34. b=0; // previous coord.y  
  35. A = X, // original coord.x  
  36. B = Y; // original coord.y  
  37. R=(e.pageX/W *>http://www.0771ybyy.com/news/1800.html< 999>>0)/999;  
  38. r=(e.pageY/H * 999>>0)/999;  
  39. U=e.pageX/H * 360 >>0;  
  40. D=9;  
  41. g = 360 * Math.PI / 180;  
  42. T = setInterval(f >http://www.0771ybyy.com/news/1803.html<= function (e) {  
  43. c.save();  
  44. c.globalCompositeOperation = “source-over”;  
  45. if(e!=1) {  
  46. c.fillStyle = “rgba(0,0,0,0.02)”;  
  47. c.fillRect(0, 0, W, H);  
  48. }  
  49.   
  50. c.restore();  
  51.   
  52. i = 25; while(i >http://www.0771ybyy.com/news/1802.html<–) {  
  53.   
  54. c.beginPath();  
  55.   
  56. if(D > 450 || bool) { // decrease diameter  
  57.   
  58. if(!bool) { // has hit maximum  
  59.   
  60. bool = 1;  
  61.   
  62. }  
  63.   
  64. if(D < 0.1) { //>http://www.0771ybyy.com/news/1805.html< has hit minimum  
  65.   
  66. bool = 0;  
  67.   
  68. }  
  69.   
  70. -g; // decrease theta  
  71.   
  72. -0.1; // >http://www.0771ybyy.com/news/1804.html<decrease size  
  73.   
  74. }  
  75.   
  76. if(!bool) {  
  77.   
  78. t += g; // increase theta  
  79.   
  80. D += 0.1; // increase size  
  81.   
  82. }  
  83.   
  84. q = (R / r – 1)>http://www.0771ybyy.com/news/1807.html< * t;  
  85.   
  86. x = (R – r) * C(t) + D * C(q) + (A + (X – A) * (i / 25)) + (r – R); // center on xy coords  
  87.   
  88. y = (R – r) * S(t) >http://www.0771ybyy.com/news/1806.html<– D * S(q) + (B + (Y – B) * (i / 25));  
  89.   
  90. if (a) {  
  91.   
  92. c.moveTo(a, b);  
  93.   
  94. c.lineTo>http://www.0771ybyy.com/news/1809.html<(x, y)  
  95.   
  96. }  
  97.   
  98. c.strokeStyle = “hsla(” + (U % 360) + “,100%,50%,0.75)”; // draw rainbow hypotrochoid  
  99.   
  100. c.stroke();  
  101.   
  102. a = x; // set previous coord.x  
  103.   
  104. b = y; >http://www.0771ybyy.com/news/1808.html<// set previous coord.y  
  105.   
  106. }  
  107.   
  108. -0.5; // increment hue  
  109.   
  110. A = X; // set original coord.x  
  111.   
  112. B = Y; // set original coord.y  
  113.   
  114. }, 16);  
  115.   
  116. }  
  117.   
  118. document.onkeydown = function(e) { a=b=0; R += 0.05 }  
  119. canvas.onmousemove>http://www.0771ybyy.com/news/1810.html<({pageX:300, pageY:290})  
  120. }</script>  
  121. </head>  
  122. <body style=”margin:0px;padding:0px;width:100%;height:100%;overflow:hidden;”>  
  123. <canvas id=”myCanvas”></canvas>  
  124. </body>  
  125. </html>  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值