Advertisement
BrU32

JS Canvas Webcam The Trippy 360 Flip FX SRC

Feb 12th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:saturate(8820%);
  4. }
  5. </style>
  6. <center>
  7. <body onmousemove="setInterval(Load_Img('https://api.audiotool.com/track/dj_bru_-_acid_step/2/cover/128.jpg?showDefault=true'),33)" background-color="white">
  8. <video id="video" autoplay hidden>
  9. </video>
  10. <canvas id="canvas" width="5000" height="5000" style="drawColor:#FFFFFF">
  11. <script>
  12. var video = document.getElementById("video");
  13. var c = document.getElementById("canvas");
  14. var ctx = c.getContext("2d");
  15. var i=0;
  16. var mediaConfig = { video:true,audio:false};
  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.drawImage(video,Math.PI,Math.PI,window.innerHeight,window.innerWidth)},31);
  22. }, false);
  23. });
  24.  
  25. function Load_Img(path){
  26. var h,w;
  27. h=('5000');
  28. w=('5000')
  29. var canvas = document.getElementById("canvas");
  30. var ctx = canvas.getContext("2d");
  31. var img = new Image();
  32. img.src=(path)
  33. ctx.translate(event.x,event.y)
  34. ctx.rotate(event.x/2,event.y*2)
  35. ctx.strokeImage(img,event.x/2,event.y/2,event.x/2,event.y/2);
  36.  
  37. }
  38. </script>
  39.  
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement