Advertisement
BrU32

JS Canvas Random Webcam Opacity With CSS FLIR FX

Dec 14th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. <style>
  6. body{
  7. filter:invert(180%);
  8. <--filter:brightness(300%);
  9. }
  10. </style
  11.  
  12. <center>
  13. <canvas id="canvas" width='1000' height='1000'></canvas>
  14.  
  15. <body bgcolor="black" onload="setInterval('for(var i=0;i<4444;i++){drawe();'drawe,'993);}">
  16. <video id="video" autoplay hidden>
  17. </video>
  18. <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
  19. <script>
  20. var ii=1;
  21.  
  22. var video = document.getElementById("video");
  23. var c = document.getElementById("canvas");
  24. var ctx = c.getContext("2d");
  25. var canvas = document.getElementById('canvas');
  26. var context = canvas.getContext('2d');
  27. var video = document.getElementById('video');
  28. var mediaConfig = { video: true,audio:false};
  29. function drawe(){
  30. }
  31. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  32. video.src = this.window.URL.createObjectURL(stream);
  33. video.play();
  34. ii-=50;
  35. video.addEventListener("play", function() {i = window.setInterval(function() {
  36. ctx.drawImage(video,ii,ii)},1);
  37. canvas.style.opacity=Math.random()*1.0;
  38. ctx.fill();
  39. drawe();
  40. }, false);
  41. });
  42.  
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement