BrU32

JS Canvas Psychedelic Seizure TV Screen Motion Test SRC

Aug 12th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <html>
  2. <body onload="setInterval(drawe,1.1)
  3. setInterval(drawf,1.2)" 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. var c = document.getElementById("myCanvas");
  17. var ctx = c.getContext("2d");
  18. ctx.beginPath();
  19. ctx.fillRect( 33,35, Math.random()*1000, 1000, 130);
  20. ctx.fill();
  21. text='';
  22. }
  23. function drawf(){
  24. var text = "";
  25. var possible = "FABCGDE0123456789";
  26. var canvas = document.getElementById("myCanvas");
  27. var ctx = canvas.getContext("2d");
  28. for(var i=0; i!=6; i++)
  29. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  30. ctx.strokeStyle='#'+text;
  31. ctx.fillStyle="#"+text;
  32. var c = document.getElementById("myCanvas");
  33. var ctx = c.getContext("2d");
  34. ctx.beginPath();
  35. ctx.fillRect( 109,35, Math.random()*1000, 1000, 130);
  36. ctx.fill();
  37. text='';
  38. }
  39. drawf();
  40. </script>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment