Advertisement
BrU32

JS Canvas 3D Webcam Cutting Through The Red Sea Fx SRC

Jan 16th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <style>
  2. canvas{
  3. filter:invert(180%);
  4. }
  5. </style>
  6. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  7. <video id="video" autoplay hidden>
  8. </video>
  9. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  10. <script>
  11. var i=0;
  12. var video = document.getElementById("video");
  13. var canvas = document.getElementById("canvas");
  14. var ctx = canvas.getContext("2d");
  15. var video = document.getElementById('video');
  16. var mediaConfig = { video: true,audio:true};
  17. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  18. video.src = this.window.URL.createObjectURL(stream);
  19. video.play();
  20. video.addEventListener("play", function() {i = window.setInterval(function() {
  21. ctx.shadowBlur = i+1000;
  22. ctx.shadowColor = "#00FFF0";
  23.  
  24. ctx.drawImage(video,i++,i++,100,100)},100);
  25. ctx.draw();
  26. },true);
  27. });
  28.  
  29. </script>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement