Advertisement
BrU32

JS Canvas Webcam Rainbow FX Inside W\ Creepy Font Demo SRC

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