超级绚丽的HTML5的页面

超级绚丽的html5的页面

成都创新互联公司主要为客户提供服务项目涵盖了网页视觉设计、VI标志设计、营销推广、网站程序开发、HTML5响应式网站建设公司手机网站开发、微商城、网站托管及网站维护、WEB系统开发、域名注册、国内外服务器租用、视频、平面设计、SEO优化排名。设计、前端、后端三个建站步骤的完善服务体系。一人跟踪测试的建站服务标准。已经为成都汽车玻璃修复行业客户提供了网站建设服务。

  
 
 
 
  1.  
  2.  
  3.  
  4. 超级绚丽的html5的页面 
  5.  
  6. window.onload = function () {  
  7. C = Math.cos;  
  8. S = Math.sin;  
  9. U = 0;  
  10. canvas = document.getElementById(“myCanvas”);  
  11. c = canvas.getContext(“2d”);  
  12. var W = canvas.width = window.innerWidth;  
  13. var H = canvas.height = window.innerHeight;  
  14. c.fillRect(0, 0, W, H); // resize  and draw black rect (default)  
  15. c.globalCompositeOperation = “lighter”; // switch to additive color application  
  16. c.lineWidth = 0.2;//设置画笔的大小  
  17. c.lineCap = “round”;//设置圆滑  
  18. var bool = 0,  
  19. t = 0; // theta  
  20. canvas.onmousemove = function (e) {  
  21. if(window.T) {  
  22. if(D==9) {  
  23. D=Math.random()*15; f(1); }  
  24. clearTimeout(T);  
  25. }  
  26. X = e.pageX; // grab mouse pixel coords  
  27. Y = e.pageY;  
  28. a=0; // previous coord.x  
  29. b=0; // previous coord.y  
  30. A = X, // original coord.x  
  31. B = Y; // original coord.y  
  32. R=(e.pageX/W * 999>>0)/999;  
  33. r=(e.pageY/H * 999>>0)/999;  
  34. U=e.pageX/H * 360 >>0;  
  35. D=9;  
  36. g = 360 * Math.PI / 180;  
  37. T = setInterval(f = function (e) {  
  38. c.save();  
  39. c.globalCompositeOperation = “source-over”;  
  40. if(e!=1) {  
  41. c.fillStyle = “rgba(0,0,0,0.02)”;  
  42. c.fillRect(0, 0, W, H);  
  43. }  
  44. c.restore();  
  45. i = 25; while(i –) {  
  46. c.beginPath();  
  47. if(D > 450 || bool) { // decrease diameter  
  48. if(!bool) { // has hit maximum  
  49. bool = 1;  
  50. }  
  51. if(D < 0.1) { // has hit minimum  
  52. bool = 0;  
  53. }  
  54. t -= g; // decrease theta  
  55. D -= 0.1; // decrease size  
  56. }  
  57. if(!bool) {  
  58. t += g; // increase theta  
  59. D += 0.1; // increase size  
  60. }  
  61. q = (R / r – 1) * t;  
  62. x = (R – r) * C(t) + D * C(q) + (A + (X – A) * (i / 25)) + (r – R); // center on xy coords  
  63. y = (R – r) * S(t) – D * S(q) + (B + (Y – B) * (i / 25));  
  64. if (a) {  
  65. c.moveTo(a, b);  
  66. c.lineTo(x, y)  
  67. }  
  68. c.strokeStyle = “hsla(” + (U % 360) + “,100%,50%,0.75)”; // draw rainbow hypotrochoid  
  69. c.stroke();  
  70. a = x; // set previous coord.x  
  71. b = y; // set previous coord.y  
  72. }  
  73. U -= 0.5; // increment hue  
  74. A = X; // set original coord.x  
  75. B = Y; // set original coord.y  
  76. }, 16);  
  77. }  
  78. document.onkeydown = function(e) { a=b=0; R += 0.05 }  
  79. canvas.onmousemove({pageX:300, pageY:290})  
  80.  
  81.  
  82.  
  83.  
  84.  

 

当前标题:超级绚丽的HTML5的页面
本文地址:http://www.hantingmc.com/qtweb/news43/516993.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联