Advertisement
BrU32

JS Quater Of A Rainbow Splatter Circle FX SRC

Jan 25th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <center>
  2. <body onmousemove="setInterval(drawe,10)" 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.  
  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,i++,i++,i++,i++)},10);
  18. ctx.topmost=false;
  19. ctx.fill();
  20. }, false);
  21. });
  22.  
  23. var i=500;
  24. function drawe(){
  25. i++;
  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!=6; i++)
  31. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  32. ctx.font="23px Sans Serif";
  33. ctx.fillStyle="#"+text;
  34. var c = document.getElementById("canvas");
  35. var ctx = c.getContext("2d");
  36. ctx.beginPath();
  37.  
  38. ctx.fillText(""+inn,Math.random()*i+90,Math.random()*i+90,Math.random()*i++,i++,i++);
  39. ctx.rotate(180%Math.PI*2)
  40. ctx.draw();
  41. text='';
  42. }
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement