Advertisement
BrU32

JS Canvas Webcam Big Random Squares Balls And Rainbow Flir

Mar 1st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <style>
  2. body{
  3.  
  4. filter:brightness(380);
  5. filter:invert(186%);
  6.  
  7.  
  8.  
  9. }
  10. </style>
  11. <center>
  12. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  13. <video id="video" autoplay hidden>
  14. </video>
  15. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none;">
  16. <script>
  17. var ii=1;
  18. var video = document.getElementById("video");
  19. var c = document.getElementById("canvas");
  20. var ctx = c.getContext("2d");
  21. var canvas = document.getElementById('canvas');
  22. var context = canvas.getContext('2d');
  23. var video = document.getElementById('video');
  24. var mediaConfig = { video: true,audio:false};
  25. function drawe(){
  26. var possible = "FABCGDE0123456789";
  27. var text = "";
  28. var canvas = document.getElementById("canvas");
  29. var ctx = canvas.getContext("2d");
  30. for(var i=0; i!=6; i++)
  31. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  32. ctx.fillStyle="#"+text;
  33. ctx.beginPath();
  34. ctx.arc(event.x,24,24,24,Math.random()*33);
  35. ctx.arc(event.y,event.y,24,24,33);
  36. ctx.fillText("yo",event.x,event.y,204,204);
  37. ctx.fillRect(Math.random()*event.x,Math.random()*event.y,22,Math.random()*22)
  38.  
  39. ctx.fill();
  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. video.play();
  46. video.addEventListener("play", function() {i = window.setInterval(function() {
  47.  
  48. ctx.topmost=false;
  49. ctx.drawImage(video,1,1,1000,1000)},200);
  50. ctx.fill();
  51. drawe;
  52. drawe;
  53. }, false);
  54. });
  55. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement