Advertisement
BrU32

JS Webcam Canvas Kool Contrast Shake Down SRC

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