BrU32

JS Canvas Rainbow Waterfall Render SRC V2

Sep 8th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. <html>
  2. <body onload="setInterval(drawe,55)" background-color="white">
  3. <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
  4. </canvas>
  5. <script>
  6. var ii=4;
  7. var text='#red';
  8. function drawe(){
  9. ii++;
  10. var text = "";
  11. var possible = "FABCGDE0123456789";
  12. var canvas = document.getElementById("myCanvas");
  13. var ctx = canvas.getContext("2d");
  14. for(var i=0; i!=6; i++)
  15. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  16. ctx.strokeStyle='#'+text;
  17. ctx.fillStyle="#"+text;
  18. var c = document.getElementById("myCanvas");
  19. var ctx = c.getContext("2d");
  20. var cts=c.getContext("2d");
  21. ctx.beginPath();
  22. //text='';
  23. ctx.fillRect(10,1,100,Math.random()*ii,ii);
  24. ctx.fillRect(30,1,100,Math.random()*ii,ii);
  25. ctx.fillRect(50,1,100,Math.random()*ii,ii);
  26. ctx.fillRect(70,1,100,Math.random()*ii,ii);
  27. ctx.fillRect(90,1,100,Math.random()*ii,ii);
  28. ctx.fillRect(110,1,100,Math.random()*ii,ii);
  29. ctx.fillRect(130,1,100,Math.random()*ii,ii);
  30. ctx.fillRect(150,1,100,Math.random()*ii,ii);
  31. ctx.fillRect(170,1,100,Math.random()*ii,ii);
  32. ctx.fillRect(190,1,100,Math.random()*ii,ii);
  33. ctx.fillRect(210,1,100,Math.random()*ii,ii);
  34. ctx.fillRect(230,1,100,Math.random()*ii,ii);
  35. ctx.fillRect(250,1,100,Math.random()*ii,ii);
  36. ctx.fillRect(270,1,100,Math.random()*ii,ii);
  37. ctx.fillRect(290,1,100,Math.random()*ii,ii);
  38. ctx.fillRect(310,1,100,Math.random()*ii,ii);
  39. ctx.fillRect(330,0,100,Math.random()*ii,ii);
  40. ctx.fillRect(350,0,100,Math.random()*ii,ii);
  41. ctx.fillRect(370,1,100,Math.random()*ii,ii);
  42. ctx.fillRect(390,1,100,Math.random()*ii,ii);
  43. ctx.fillRect(410,0,100,Math.random()*ii,ii);
  44. ctx.fillRect(430,1,100,Math.random()*ii,ii);
  45. ctx.fillRect(450,1,100,Math.random()*ii,ii);
  46. ctx.fillRect(470,0,100,Math.random()*ii,ii);
  47. ctx.fillRect(490,0,100,Math.random()*ii,ii);
  48. ctx.fillRect(510,1,100,Math.random()*ii,ii);
  49. ctx.fillRect(530,1,100,Math.random()*ii,ii);
  50. ctx.fillRect(550,1,100,Math.random()*ii,ii);
  51. ctx.fillRect(570,1,100,Math.random()*ii,ii);
  52. ctx.fillRect(590,1,100,Math.random()*ii,ii);
  53. ctx.fillRect(610,1,100,Math.random()*ii,ii);
  54. ctx.fillRect(630,1,100,Math.random()*ii,ii);
  55. ctx.fillRect(650,1,100,Math.random()*ii,ii);
  56. ctx.fillRect(670,1,100,Math.random()*ii,ii);
  57. ctx.fillRect(690,1,100,Math.random()*ii,ii);
  58. ctx.drawRect(710,1,100,Math.random()*ii,ii);
  59. ctx.reraw();
  60. //text='';
  61. }
  62. </script>
  63. </body>
Advertisement
Add Comment
Please, Sign In to add comment