Advertisement
BrU32

JS Canvas Webcam Rainbow Rain FX SRC

Jan 27th, 2017
148
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:brightness(3%);
  4. filter:saturate(1114%);
  5.  
  6. }
  7.  
  8. </style>
  9. <canvas id="canvas" width='1000' height='1000'></canvas>
  10.  
  11. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubleclick="drawe;">
  12. <video id="video" autoplay hidden>
  13. </video>
  14. <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
  15. <script>
  16. var ii=10;
  17.  
  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:0};
  25. function drawe(){
  26. }
  27. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  28. video.src = this.window.URL.createObjectURL(stream);
  29. video.play();
  30. ii+=50;
  31. video.addEventListener("play", function() {i = window.setInterval(function() {
  32. canvas.style.opacity+=0.9;
  33. ctx.drawImage(video,i+Math.random()*500,ii+Math.random()*500,Math.random()*i,Math.random()*ii)},1);
  34. ctx.draw();
  35. drawe();
  36. }, false);
  37. });
  38. </script>
  39. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement