Advertisement
BrU32

JS Canvas Webcam Rainbow Sound Bars FX Final Version SRC

Feb 3rd, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:contrast(33334454543%);
  4.  
  5. filter:saturation(12353333334%);
  6.  
  7. }
  8.  
  9.  
  10.  
  11. </style>
  12. <center>
  13. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  14. <video id="video" autoplay hidden>
  15. </video>
  16. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  17. <script>
  18. var ii=1;
  19. var video = document.getElementById("video");
  20. var c = document.getElementById("canvas");
  21. var ctx = c.getContext("2d");
  22. var canvas = document.getElementById('canvas');
  23. var context = canvas.getContext('2d');
  24. var video = document.getElementById('video');
  25. var mediaConfig = { video: true,audio:false};
  26. function drawe(){
  27. var possible = "FABCGDE0123456789";
  28. var text = "";
  29. var canvas = document.getElementById("canvas");
  30. var ctx = canvas.getContext("2d");
  31. for(var i=0; i!=6; i++)
  32. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  33. ctx.fillStyle="#"+text;
  34. ctx.beginPath();
  35. ctx.arc(event.x,event.y,window.devicepixelRatioX,window.devicepixelRatioY,Math.random()*Math.PI);
  36. ctx.fillRect(Math.random()*event.x,Math.random()*event.y,canvas.height/canvas.height^50/event.x,canvas.width/canvas.height^50/Math.random()*event.y);
  37. ctx.fillRect(Math.random()*event.x,Math.random()*event.y,canvas.height/canvas.height^50/event.x,canvas.width/canvas.height^50/Math.random()*event.y);
  38. ctx.arc(event.x,event.y,window.devicepixelRatioX,window.devicepixelRatioY,Math.random()*Math.PI);
  39. ctx.fillRect(Math.random()*event.x,Math.random()*event.y,canvas.height/canvas.height^50/event.x,canvas.width/canvas.height^50/Math.random()*event.y);
  40. ctx.fillRect(Math.random()*event.x,Math.random()*event.y,canvas.height/canvas.height^50/event.x,canvas.width/canvas.height^50/Math.random()*event.y);
  41.  
  42. text='';
  43. }
  44. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  45. if(ctx.width==500){event.mouseMove++;}
  46. video.src = this.window.URL.createObjectURL(stream);
  47. video.play();
  48. video.addEventListener("play", function() {i = window.setInterval(function() {
  49.  
  50.  
  51.  
  52. ctx.drawImage(video,1,1,500,500)},50);
  53. ctx.draw();
  54. drawe;
  55. drawe;
  56. }, false);
  57. });
  58. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement