Advertisement
BrU32

JS Canvas Webcam Flir W\ Shadow Color Rainbow Random Pic SRC

Feb 5th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 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. ctx.moveTo(Math.random()*event.x+11,Math.random()*event.x/500);
  36. ctx.lineTo(Math.random()*event.y*11,Math.random()*event.y-500);
  37. ctx.topmost=false;
  38.  
  39. ctx.stroke();
  40. text='';
  41. }
  42. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  43. if(ctx.width==500){event.mouseMove++;}
  44. video.src = this.window.URL.createObjectURL(stream);
  45. var store =video.src;
  46. video.play();
  47. video.addEventListener("play", function() {i = window.setInterval(function() {
  48. canvas.style.opacity-=0.1
  49. canvas.style.opacity++;
  50. ctx.shadowBlur = i++;
  51. ctx.topmost=false;
  52.  
  53. ctx.drawImage(video,1,1,Math.random()*500,Math.random()*500)},35);
  54. ctx.draw();
  55. drawe;
  56. }, false);
  57. window.onkeydown=function(){
  58. this.video.src=('');
  59. this.video.pause();
  60. alert('Click Any Place To Restart Webcam/Effect!!')
  61.  
  62. }
  63. window.onclick=function(){
  64. this.video.src=(store);
  65. this.video.play();
  66.  
  67. }
  68. });
  69. </script>
  70. </body>
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement