Advertisement
BrU32

JS Canvas Webcam UFO Broadcast 2016 FINAL EDITION!!!!!

Oct 26th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <center>
  2. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  3. <video id="video" autoplay hidden>
  4. </video>
  5. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  6. <script>
  7. var ii=1;
  8. var inn=244;
  9. var video = document.getElementById("video");
  10. var c = document.getElementById("canvas");
  11. var ctx = c.getContext("2d");
  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. function drawe(){
  17. var possible = "FABCGDE0123456789";
  18. var text = "";
  19. var canvas = document.getElementById("canvas");
  20. var ctx = canvas.getContext("2d");
  21. for(var i=0; i!=6; i++)
  22. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  23. ctx.strokeStyle="#"+text;
  24. ctx.moveTo(event.x+4,event.y-4);
  25. ctx.lineTo(event.x+4,event.y-1);
  26. ctx.topmost=true;
  27. text='';
  28. }
  29. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  30. if(ctx.width==500){event.mouseMove++;}
  31. video.src = this.window.URL.createObjectURL(stream);
  32. video.play();
  33. video.addEventListener("play", function() {i = window.setInterval(function() {
  34. canvas.style.opacity-=0.1
  35. canvas.style.opacity+=0.3;
  36. ctx.topmost=false;
  37. ctx.drawStyle=''
  38. ctx.drawImage(video,Math.random()*-40,Math.random()*-40)},0.1);
  39. ctx.draw();
  40. drawe;
  41. }, false);
  42. });
  43. </script>
  44. <script>
  45. var context = new AudioContext();
  46. var lfo = context.createOscillator();
  47. lfo.frequency.value = 12;
  48. var hfo = context.createOscillator();
  49. hfo.frequency.value = 250;
  50. var modulationGain = context.createGain();
  51. modulationGain.gain.value = 122;
  52. lfo.connect(modulationGain);
  53. modulationGain.connect(hfo.detune);
  54. hfo.connect(context.destination);
  55. hfo.start(0);
  56. lfo.start(0);
  57. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement