BrU32

JS Canvas 3D Bars SRC

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