Advertisement
BrU32

JS Canvas Webcam Twinkle Yellow Stars Toxic Galaxy SRC

Jan 25th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1.  
  2. <style>
  3. body{
  4.  
  5. filter:contrast(12);
  6.  
  7. }
  8. canvas{
  9.  
  10. filter:invert(3350%);
  11.  
  12.  
  13. }
  14. </style>
  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=100;
  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=Math.random()*0.9;
  39. ctx.drawImage(video,i+Math.random()*1000,i+Math.random()*1000-1,Math.random()*i-2,Math.random()*i-2)},0.1);
  40.  
  41. drawe();
  42. }, false);
  43. });
  44. </script>
  45. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement