Advertisement
BrU32

JS Canvas Webcam Wired Rainbow Circles FX SRC V1

Jan 20th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:contrast(10000%);
  4.  
  5.  
  6. }
  7.  
  8. </style>
  9.  
  10. <center>
  11. <body onmousemove="setInterval(drawe,3000)" bgcolor="black">
  12. <video id="video" autoplay hidden>
  13. </video>
  14. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  15. <script>
  16. var video = document.getElementById("video");
  17. var c = document.getElementById("canvas");
  18. var ctx = c.getContext("2d");
  19. var i=0;
  20. var mediaConfig = { video:true,audio:false};
  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,1,1)},200);
  26. ctx.topmost=false;
  27. ctx.draw();
  28. }, false);
  29. });
  30.  
  31. var ii=50;
  32. function drawe(){
  33. ii++;
  34. var text = "";
  35. var possible = "FABCGDE0123456789";
  36. var canvas = document.getElementById("canvas");
  37. var ctx = canvas.getContext("2d");
  38. for(var i=0; i!=6; i++)
  39. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  40. ctx.font=""+i+"px Sans Serif";
  41. ctx.strokeStyle="#"+text;
  42. var c = document.getElementById("canvas");
  43. var ctx = c.getContext("2d");
  44. ctx.beginPath();
  45. ctx.arc(Math.random()*ii+1,Math.random()*ii,Math.random()*ii,Math.random()*ii-10,ii+10);
  46. ctx.stroke();
  47.  
  48. text='';
  49. }
  50. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement