Advertisement
BrU32

JS Canvas Webcam Night Vision Moving Cube FX

Mar 6th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <style>
  2. canvas{
  3. filter:flip(433%);
  4.  
  5.  
  6. }
  7. </style>
  8.  
  9. <center>
  10. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  11. <video id="video" autoplay hidden>
  12. </video>
  13. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  14. <script>
  15. var i=22
  16. var video = document.getElementById("video");
  17. var canvas = document.getElementById("canvas");
  18. var ctx = canvas.getContext("2d");
  19. var video = document.getElementById('video');
  20. var mediaConfig = { video: true,audio:true};
  21. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  22. video.src = this.window.URL.createObjectURL(stream);
  23. video.play();
  24. video.addEventListener("play", function() {i = window.setInterval(function() {
  25. ctx.drawImage(video,i,i,500,500)},100);
  26. ctx.draw();
  27. },true);
  28. });
  29. </script>
  30. </body>
  31. </html>>
  32. </body>
  33. </html>
  34. <style>
  35. canvas{
  36. filter:invert(433%);
  37.  
  38.  
  39. }
  40. </style>
  41. <center>
  42. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  43. <video id="video" autoplay hidden>
  44. </video>
  45. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  46. <script>
  47. var i=22
  48. var video = document.getElementById("video");
  49. var canvas = document.getElementById("canvas");
  50. var ctx = canvas.getContext("2d");
  51. var video = document.getElementById('video');
  52. var mediaConfig = { video: true,audio:0};
  53. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  54. video.src = this.window.URL.createObjectURL(stream);
  55. video.play();
  56. video.addEventListener("play", function() {i = window.setInterval(function() {
  57. ctx.drawImage(video,i++,i,500,50)},100);
  58. ctx.draw();
  59. },true);
  60. });
  61. </script>
  62. </body>
  63. </html>>
  64. </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement