BrU32

JS Canvas Random Colorful Pipes Drawing SRC V1

Aug 18th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <html>
  2. <center>
  3. <body onload="setInterval(drawe,100)" background-color="white">
  4. <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
  5. </canvas>
  6. <script>
  7. function drawe(){
  8. var text = "";
  9. var possible = "FABCGDE0123456789";
  10. var canvas = document.getElementById("myCanvas");
  11. var ctx = canvas.getContext("2d");
  12. for(var i=0; i!=6; i++)
  13. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  14. ctx.strokeStyle='#'+text;
  15. ctx.fillStyle="#"+text;
  16. ctx.strokeRect(Math.random()*1000,Math.random()*1000,Math.random()*10000,Math.random()*10000);
  17. ctx.stroke();
  18. text='';
  19. }
  20. </script>
  21. </body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment