Advertisement
BrU32

JS Webcam Canvas Beaming Rainbow Lasers Through Cam FX SRC

Feb 27th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:hue-rotate(9000000deg);
  4. filter:invert(42228882334434456464);
  5.  
  6.  
  7. }
  8. canvas{
  9. filter:brightness(200%);
  10. }
  11. </style>
  12. <center>
  13. <body onmousemove="drawe();" onmousedown="drawe" onmouseup="drawe" ommouseover="drawe" onchange="drawe" onload="drawe" onpaint="drawe" ondoubleclick="drawe;">
  14. <video id="video" autoplay hidden>
  15. </video>
  16. <canvas id="canvas" onchange="drawe;" topmost="false" onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  17. <script>
  18. var ii=1;
  19. var video = document.getElementById("video");
  20. var c = document.getElementById("canvas");
  21. var ctx = c.getContext("2d");
  22. var canvas = document.getElementById('canvas');
  23. var context = canvas.getContext('2d');
  24. var video = document.getElementById('video');
  25. var mediaConfig = { video: true,audio:false};
  26. function drawe(){
  27. var possible = "FABCGDE0123456789";
  28. var text = "";
  29. var canvas = document.getElementById("canvas");
  30. var ctx = canvas.getContext("2d");
  31. for(var i=0; i!=6; i++)
  32. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  33. ctx.strokeStyle="#"+text;
  34. ctx.shadowColor = "#"+text;
  35.  
  36. ctx.moveTo(Math.random()*1,Math.random()*1);
  37. ctx.lineTo(Math.random()*500,Math.random()*500);
  38. ctx.topmost=false;
  39.  
  40. ctx.stroke();
  41. text='';
  42. }
  43. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  44. if(ctx.width==500){event.mouseMove++;}
  45. video.src = this.window.URL.createObjectURL(stream);
  46. var store =video.src;
  47. video.play();
  48. video.addEventListener("play", function() {i = window.setInterval(function() {
  49. canvas.style.opacity-=0.1
  50. canvas.style.opacity++;
  51. ctx.shadowBlur =10;
  52. ctx.topmost=false;
  53.  
  54. ctx.drawImage(video,0,0,400,400)},35);
  55. ctx.draw();
  56. drawe;
  57. }, false);
  58. window.onkeydown=function(){
  59. this.video.src=('');
  60. this.video.pause();
  61. alert('Click Any Place To Restart Webcam/Effect!!')
  62.  
  63. }
  64. window.onclick=function(){
  65. this.video.src=(store);
  66. this.video.play();
  67.  
  68. }
  69. });
  70. </script>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement