2015 New Year's Day to a dazzling HTML5 effects

Source: Internet
Author: User

Effect URL: http://keleyi.com/keleyi/phtml/html5/5.htm



Code:

HTML code
  1. <! DOCTYPE HTML>
  2. <HTML xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>2015 New Year's Day to a dazzling HTML5 effects-keeper </title><base target="_blank" />
  5. <script type="Text/javascript"> window.onload = function () { /c14>
  6. C =Math.Cos;S =Math.sin;U =0;W =Windowj =DocumentD =J.getelementbyid ("Kele" + "yi_com");c =D.getcontext ("2d");W =d.width = w.innerwidth;  h = d.height =  w.innerheight; c.fillrect (0, 0, w, h);  c.globalcompositeoperation =  "lighter";  c.linewidth = 0.2; c.linecap  =  "round";  var bool = < Span class= "Attribute-value" >0, t = 0;  d.onmousemove = function  (e)  {   
  7. if (window. T) {
  8. if (d = = 9) { d = math.random () *, f (1);}
  9. Cleartimeout (T);
  10. }
  11. X =E.pagex;Y =E.pagey;A =0;b =0;A =XB =Yr =  (e.pagex / w * 999 >> 0)  / 999; r =  (e.pagey / h  * 999 >> 0)  / 999;  u = e.pagex / h * 360  >> 0; d = 9; g = 360 *  math.pi / 180; t =  SetInterval (f = function  (e)  {   
  12. C.save ();  c.globalcompositeoperation = "Source-over", if (E! = 1) { C.fillstyle = "Rgba (0,0,0,0.02)"; C.fillrect (0, 0, W, H); }  
  13. C.restore (); i = + ; while (i--) {
  14. C.beginpath (); if (D > | | bool) {
  15. if (!bool) { bool = 1;}
  16. if (D < 0.1) { bool = 0;}
  17. T- = g;  D- = 0.1;
  18. }
  19. if (!bool) {T + = g; D + = 0.1; }
  20. q =  (r / r - 1)  * t;  x =  (r - r)  * c (t)  + d * c (q)  +   (a +  (x - a)  *  (i / 25))  +  (r - r);  < span class= "attribute" >y =  (r - r)  * s (t)  - d * s (q)  +   (b +  (y - b)  *  (i / 25)); if  (a)  { c.moveto ( A,&NBSP;B);  c.lineto (x, y)  }  
  21. C.strokestyle = "Hsla (" + (U% 360) + ", 100%,50%,0.75)"; C.stroke (); a = x;  B = y;
  22. }
  23. U- = 0.5; A = X;  B = Y;
  24. }, 16);
  25. }
  26. J.onkeydown = function (e) { a = b = 0; R + = 0.05}
  27. D.onmousemove ({pagex:300, pagey:290})
  28. }</script>
  29. <style>body{margin:0;overflow:hidden}div{padding:1px 5px;background: #333;p osition:absolute; Z-index:2;color: #555; Font-family:arial}a{color: #ccf}a:hover{color:red}</style>
  30. </head>
  31. <body>
  32. <Div><a href= "http://keleyi.com/" span class= "tag" >> home </a>  <a href= "http://keleyi.com/a/bjad/8e9jd0u5.htm" > original </a> < a href= http://keleyi.com/ keleyi/phtml/"> Effect library </a> What can  1kb's JavaScript do? </div>  
  33. <div id="text"></div>
  34. <canvas id="keleyi_com"></canvas>
  35. </body>
  36. </html>

Effects:

2015 New Year's Day to a dazzling HTML5 effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.