Advertisement
BrU32

JS Canvas Webcam Double Super FLIR SRC

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