Advertisement
BrU32

JS Canvas Webcam Ra1nbow Radiation Text Bounce FX SRC V1

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