Advertisement
BrU32

JS Webcam Rainbow Confettiy SRC V2

Feb 17th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. <style>
  2. body{
  3.  
  4. filter:flip(18%);
  5. filter:invert(6126%);
  6.  
  7. filter:brightness(102%);
  8. }
  9. </style>
  10. <center>
  11. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  12. <video id="video" autoplay hidden>
  13. </video>
  14. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  15. <script>
  16. var ii=1;
  17. var video = document.getElementById("video");
  18. var c = document.getElementById("canvas");
  19. var ctx = c.getContext("2d");
  20. var canvas = document.getElementById('canvas');
  21. var context = canvas.getContext('2d');
  22. var video = document.getElementById('video');
  23. var mediaConfig = { video: true,audio:true};
  24. function drawe(){
  25. var possible = "FABCGDE0123456789";
  26. var text = "";
  27. var canvas = document.getElementById("canvas");
  28. var ctx = canvas.getContext("2d");
  29. for(var i=0; i!=6; i++)
  30. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  31. ctx.fillStyle="#"+text
  32. ctx.beginPath();
  33. ctx.fillRect(Math.random()*event.x++,Math.random()*event.y++,Math.random()*2,Math.random()*4)
  34. ctx.fillRect(Math.random()*event.x++,Math.random()*event.y++,Math.random()*2,Math.random()*4)
  35. ctx.fillRect(Math.random()*event.x++,Math.random()*event.y++,Math.random()*2,Math.random()*4)
  36. ctx.fillRect(Math.random()*event.x++,Math.random()*event.y++,Math.random()*2,Math.random()*4)
  37. ctx.fillRect(Math.random()*event.x++,Math.random()*event.y++,Math.random()*2,Math.random()*4)
  38. ctx.fill();
  39. text='';
  40. }
  41. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  42. if(ctx.width==500){event.mouseMove++;}
  43. video.src = this.window.URL.createObjectURL(stream);
  44. video.play();
  45. video.addEventListener("play", function() {i = window.setInterval(function() {
  46.  
  47. ctx.topmost=false;
  48. ctx.drawImage(video,1,1,500,500)},200);
  49. ctx.fill();
  50. drawe;
  51. drawe;
  52. }, false);
  53. });
  54. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement