BrU32

Js MultiColor Random Strait Line Canvas Drawing SRC

Nov 29th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. ​<html>
  2. <body onmousemove="setInterval(drawe(),0.003);" style="width:1000;height:1000" bgcolor="red">
  3. <canvas id="myCanvas" width="10000" height="10000" style="background:black;">
  4. </canvas>0
  5. <script>
  6. function drawe(){
  7. var text = "";
  8. var possible = "FABCGDE0123456789";
  9. var canvas = document.getElementById("myCanvas");
  10. var ctx = canvas.getContext("2d");
  11. ctx.moveTo(event.y,event.x);
  12. for(var i=0; i!=3; i++)
  13. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  14. ctx.strokeStyle='#'+text;
  15. text='';
  16. ctx.lineTo(Math.random()*event.x-Math.random(),Math.random()-event.y,event.x,event.y);
  17. ctx.stroke()
  18. ctx.paint();
  19.  
  20. }
  21.  
  22. </script>
  23. </body>
  24. </html>
Advertisement
Add Comment
Please, Sign In to add comment