Advertisement
BrU32

JS Webcam Canvas Melting With Words FX SRC V1

Jan 19th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <center>
  2. <body onmousemove="setInterval(drawe,3000)" bgcolor="black">
  3. <video id="video" autoplay hidden>
  4. </video>
  5. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  6. <script>
  7. var inn=prompt("Enter Text:")
  8. var video = document.getElementById("video");
  9. var c = document.getElementById("canvas");
  10. var ctx = c.getContext("2d");
  11. var i=0;
  12. var mediaConfig = { video:true,audio:false};
  13. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  14. video.src = this.window.URL.createObjectURL(stream);
  15. video.play();
  16. video.addEventListener("play", function() {i = window.setInterval(function() {
  17. ctx.drawImage(video,1,1)},40);
  18. ctx.topmost=false;
  19. ctx.draw();
  20. }, false);
  21. });
  22.  
  23. var ii=50;
  24. function drawe(){
  25. ii++;
  26. var text = "";
  27. var possible = "FABCGDE0123456789";
  28. var canvas = document.getElementById("canvas");
  29. var ctx = canvas.getContext("2d");
  30. for(var i=0; i!=600000; i++)
  31. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  32. ctx.font=""+i+"px Sans Serif";
  33. ctx.fillStyle="#"+text;
  34. var c = document.getElementById("canvas");
  35. var ctx = c.getContext("2d");
  36. ctx.beginPath();
  37. ctx.fillText(""+inn,Math.random()*ii+1,Math.random()*ii,Math.random()*ii,Math.random()*ii-10,ii+10);
  38.  
  39.  
  40. text='';
  41. }
  42. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement