Advertisement
BrU32

JS Customize Webcam Opacity With FLIR Rand FX SRC V1

Feb 1st, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1.  
  2. <style>
  3. body{
  4. filter:hue-rotate(9000000deg);
  5. filter:invert(42228882334434456464);
  6.  
  7.  
  8. }
  9. canvas{
  10. filter:brightness(200%);
  11. }
  12. </style>
  13. <center>
  14. <body onclick="document.body.style.opacity=(Math.random()*1.1)" bgcolor="black"></body><br><br><font color=magenta><b>Click Anywhere On This Page To Randomly Set The Webcam Opacity!!</font>
  15. <video id="video" autoplay hidden>
  16. </video>
  17. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none; width:500px">
  18. <script>
  19. var ii=1;
  20.  
  21. var video = document.getElementById("video");
  22. var c = document.getElementById("canvas");
  23. var ctx = c.getContext("2d");
  24. var canvas = document.getElementById('canvas');
  25. var context = canvas.getContext('2d');
  26. var video = document.getElementById('video');
  27. var mediaConfig = { video: true,audio:1};
  28. function drawe(){
  29. var possible = "FABCGDE0123456789";
  30. var text = "";
  31. var canvas = document.getElementById("canvas");
  32. var ctx = canvas.getContext("2d");
  33. for(var i=0; i!=6; i++)
  34. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  35. ctx.fillStyle="#"+text;
  36. ctx.beginPath();
  37. ctx.fontStyle="Sans 300px"
  38. ctx.fillText(""+inn,event.x,event.y)
  39. ctx.fillRect(event.y,event.y,event.y,event.y,250*Math.PI)
  40. ctx.arc(event.x,event.x,event.y,event.y,250*Math.PI);
  41. ctx.fill();
  42. ctx.topmost=true;
  43. ctx.stroke();
  44. text='';
  45. }
  46. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  47. if(ctx.width==500){event.mouseMove++;}
  48. video.src = this.window.URL.createObjectURL(stream);
  49. video.play();
  50. video.addEventListener("play", function() {i = window.setInterval(function() {
  51. canvas.style.opacity=1.2
  52.  
  53. ctx.topmost=false;
  54. ctx.drawImage(video,1,1,500,500)},150);
  55. ctx.draw();
  56. drawe;
  57. }, false);
  58. });
  59. </script>
  60. </body>
  61. </html>0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement