Advertisement
BrU32

JS Canvas Webcam W\ Square Pusher 2.0 FX SRC

Feb 12th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. <body bgcolor="black" onload="setInterval(Gen,333)">
  2. <video id="video" hidden>
  3. </video>
  4. <canvas id="canvas" width="2334" height="788"style="opacity:1.0;fillColor:black;">
  5. <script>
  6. var ii=1;
  7. var inn=0;
  8. var video = document.getElementById("video");
  9. var c = document.getElementById("canvas");
  10. var ctx = c.getContext("2d");
  11. var i=0;
  12. var canvas = document.getElementById('canvas');
  13. var context = canvas.getContext('2d');
  14. var video = document.getElementById('video');
  15. var mediaConfig = { video: true,audio:true};
  16. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  17. video.src = this.window.URL.createObjectURL(stream);
  18. video.play();
  19. video.addEventListener("play", function() {i = window.setInterval(function() {
  20. canvas.style.opacity=1.0;
  21. canvas.style.opacity=+Math.random()*99;
  22.  
  23. }, false);
  24. });
  25. function Gen()
  26. {
  27. var text = "";
  28. var possible = ""
  29. for(var i=0; i!=336; i++)
  30. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  31. document.body.style.backgroundColor=(text);
  32.  
  33. }
  34. </script>
  35. <center>
  36. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  37. <video id="video" autoplay hidden>
  38. </video>
  39. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  40. <script>
  41. var ii=10;
  42. var inn=24;
  43. var video = document.getElementById("video");
  44. var c = document.getElementById("canvas");
  45. var ctx = c.getContext("2d");
  46. var canvas = document.getElementById('canvas');
  47. var context = canvas.getContext('2d');
  48. var video = document.getElementById('video');
  49. var mediaConfig = { video: true,audio:0};
  50. function drawe(){
  51. var possible = "FABCGDE0123456789";
  52. var text = "";
  53. var canvas = document.getElementById("canvas");
  54. var ctx = canvas.getContext("2d");
  55. for(var i=0; i!=62; i++)
  56. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  57. ctx.strokeStyle="#"+text;
  58. ctx.moveTo(event.x+4,event.y+4);
  59. ctx.lineTo(event.x+4,event.y+4);
  60. ctx.topmost=false;
  61.  
  62. }
  63. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  64. if(ctx.width==500){event.mouseMove++;}
  65. video.src = this.window.URL.createObjectURL(stream);
  66. video.play();
  67. video.addEventListener("play", function() {i = window.setInterval(function() {
  68.  
  69. canvas.style.opacity=1.0;
  70. ctx.topmost=false;
  71. ctx.drawStyle=''
  72. //ctx.drawImage(video,Math.random()+400,Math.random()+400)},0.1);
  73. ctx.draw();
  74. drawe;
  75. }, false);
  76. });
  77. </script>
  78. <script>
  79. var context = new AudioContext();
  80.  
  81. </script>
  82.  
  83. <center>
  84. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  85. <video id="video" autoplay hidden>
  86. </video>
  87. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="234" style="opacity:1.0;fillColor:none;">
  88. <script>
  89. var ii=1;
  90. var video = document.getElementById("video");
  91. var c = document.getElementById("canvas");
  92. var ctx = c.getContext("2d");
  93. var canvas = document.getElementById('canvas');
  94. var context = canvas.getContext('2d');
  95. var video = document.getElementById('video');
  96. var mediaConfig = { video: true,audio:0};
  97. function drawe(){
  98. var possible = "FABCGDE0123456789";
  99. var text = "";
  100. var canvas = document.getElementById("canvas");
  101. var ctx = canvas.getContext("2d");
  102. for(var i=0; i!=3; i++)
  103. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  104. ctx.fillStyle="#"+text;
  105. ctx.beginPath();
  106. ctx.fillRect(Math.random()*event.x,Math.random()*event.x,Math.random()*event.y,Math.random()*event.y);
  107. //alert(event.x+":"+event.y);
  108. ctx.fill();
  109. ctx.topmost=true;
  110. ctx.stroke();
  111. text='';
  112. }
  113. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  114. if(ctx.width==500){event.mouseMove++;}
  115. video.src = this.window.URL.createObjectURL(stream);
  116. video.play();
  117. video.addEventListener("play", function() {i = window.setInterval(function() {
  118. canvas.style.opacity=1.0
  119.  
  120. ctx.topmost=false;
  121. ctx.drawImage(video,Math.random()*500,Math.random()*500,Math.random()*500,Math.random()*500)},50);
  122. ctx.draw();
  123. drawe;
  124. }, 77);
  125. });
  126. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement