Advertisement
BrU32

JS Webcam Cursor Rainbow Text Custom Effect SRC

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