Advertisement
BrU32

JS Webcam Trippy Contrast SRC

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