BrU32

JS CanvasLasers Random Fill Canvas SRC/DEMO V3

Aug 2nd, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <html>
  2. <body bgcolor="#000000" onload="var i=setInterval('drawit()',100);">
  3.  
  4. <canvas id="myCanvas" width="1000" height="1000" style="border:10px;color:red;">
  5. Your browser does not support the HTML5 canvas tag.</canvas>
  6.  
  7. <script>
  8. var onetimecolor=prompt("Enter Your Favorite Color:(ie:Red)");
  9. function drawit(){
  10. var c = document.getElementById("myCanvas");
  11. var ctx = c.getContext("2d");
  12. ctx.strokeStyle=(onetimecolor);
  13. ctx.lineThickness= "1000";
  14. for(var i=0;i<12;i++){
  15. ctx.beginPath(Math.random()*1000,Math.random()*1000);
  16. var Line=(Math.random()*1000);
  17. var Line1=(Math.random()*1000);
  18. ctx.moveTo(Line1+Math.floor(Math.random()*500), Line);
  19. ctx.lineTo(Line, Line1-Math.floor(Math.random()*500));
  20. ctx.stroke();
  21. }
  22. }
  23. </script>
  24.  
  25. </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment