Advertisement
BrU32

JS Canvas Saturation Popup Webcam SRC FINAL

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