Advertisement
BrU32

JS Glitchy Webcam SRC

Nov 14th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 KB | None | 0 0
  1. <body bgcolor="black" onload="setInterval(Gen,333)">
  2. <video id="video" autoplay hidden>
  3. </video>
  4. <canvas id="canvas" width="500" height="500"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:false};
  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()*.9;
  22. ctx.drawImage(video,1,1,500,50)},inn);
  23. }, false);
  24. });
  25. function Gen()
  26. {
  27. var text = "";
  28. var possible = ""
  29. for(var i=0; i!=6; 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:false};
  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!=6; 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=true;
  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()*-40,Math.random()*-40)},0.1);
  73. ctx.draw();
  74. drawe;
  75. }, false);
  76. });
  77. </script>
  78. <script>
  79. var context = new AudioContext();
  80. var lfo = context.createOscillator();
  81. lfo.frequency.value = 12;
  82. var hfo = context.createOscillator();
  83. hfo.frequency.value = 250;
  84. var modulationGain = context.createGain();
  85. modulationGain.gain.value = 122;
  86. lfo.connect(modulationGain);
  87. modulationGain.connect(hfo.detune);
  88. hfo.connect(context.destination);
  89. hfo.start(0);
  90. lfo.start(0);
  91. </script>
  92.  
  93. <center>
  94. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  95. <video id="video" autoplay hidden>
  96. </video>
  97. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  98. <script>
  99. var ii=1;
  100. var video = document.getElementById("video");
  101. var c = document.getElementById("canvas");
  102. var ctx = c.getContext("2d");
  103. var canvas = document.getElementById('canvas');
  104. var context = canvas.getContext('2d');
  105. var video = document.getElementById('video');
  106. var mediaConfig = { video: true,audio:false};
  107. function drawe(){
  108. var possible = "FABCGDE0123456789";
  109. var text = "";
  110. var canvas = document.getElementById("canvas");
  111. var ctx = canvas.getContext("2d");
  112. for(var i=0; i!=6; i++)
  113. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  114. ctx.fillStyle="#"+text;
  115. ctx.beginPath();
  116. ctx.arc(event.x,event.y,event.y,event.y,250*Math.PI);
  117. ctx.fill();
  118. ctx.topmost=true;
  119. ctx.stroke();
  120. text='';
  121. }
  122. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  123. if(ctx.width==500){event.mouseMove++;}
  124. video.src = this.window.URL.createObjectURL(stream);
  125. video.play();
  126. video.addEventListener("play", function() {i = window.setInterval(function() {
  127. canvas.style.opacity=1.0
  128.  
  129. ctx.topmost=false;
  130. ctx.drawImage(video,1,1,500,500)},100);
  131. ctx.draw();
  132. drawe;
  133. }, false);
  134. });
  135. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement