Advertisement
BrU32

JS Canvas Fill Image Into Webcam Fx V2

Jan 19th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:invert(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 inn=prompt("Enter Text:")
  17. var video = document.getElementById("video");
  18. var c = document.getElementById("canvas");
  19. var ctx = c.getContext("2d");
  20. var i=0;
  21. var mediaConfig = { video:true,audio:false};
  22. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  23. video.src = this.window.URL.createObjectURL(stream);
  24. video.play();
  25. video.addEventListener("play", function() {i = window.setInterval(function() {
  26. ctx.drawImage(video,1,1)},40);
  27. ctx.topmost=false;
  28. ctx.draw();
  29. }, false);
  30. });
  31.  
  32. var ii=50;
  33. function drawe(){
  34. ii++;
  35. var text = "";
  36. var possible = "FABCGDE0123456789";
  37. var canvas = document.getElementById("canvas");
  38. var ctx = canvas.getContext("2d");
  39. for(var i=0; i!=60000; i++)
  40. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  41. ctx.font=""+i+"px Sans Serif";
  42. ctx.fillStyle="#"+text;
  43. var c = document.getElementById("canvas");
  44. var ctx = c.getContext("2d");
  45. ctx.beginPath();
  46. ctx.fillText(""+inn,Math.random()*ii+1,Math.random()*ii,Math.random()*ii,Math.random()*ii-10,ii+10);
  47.  
  48.  
  49. text='';
  50. }
  51. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement