BrU32

JS Canvas Spatter SRC

Dec 17th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body onmousemove="drawe();" onchange="drawe();">
  4. <canvas id="myCanvas" width="500" height="500" style="border:1px;background-color:red;">
  5. Your browser does not support the canvas element.
  6. </canvas>
  7. <script>
  8. function drawe(){
  9. var canvas = document.getElementById("myCanvas");
  10. var ctx = canvas.getContext("2d");
  11. ctx.moveTo(event.x++,event.y=+1);
  12.  
  13. ctx.arc(Math.random()*73,Math.random()*32,Math.random()*Math.sin(event.x),Math.random()*Math.cos(event.y)*178,Math.sin(33),Math.cos(44));
  14. ctx.fill();
  15.  
  16. }
  17. </script>
  18. </body>
  19. </html>
Advertisement
Add Comment
Please, Sign In to add comment