Advertisement
BrU32

JS Canvas Webcam FLIR W\ Xmen FX

Nov 11th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <style>
  2. body{
  3. overflow: visible;
  4. position:center;
  5. width: 100%;
  6. height: 100%;
  7. filter:invert(1.0);
  8. }
  9. .container{
  10. position: center;
  11. width: Math.random()*5vmax+1vmax;
  12. height: Math.random()*15vmax+10vmax;
  13. top: 50%;
  14. left: 50%;
  15. }
  16. </style>
  17. <center>
  18. <body onload="setInterval(drawe,0.00000000000000001)" background-color="white">
  19. <video id="video" autoplay hidden>
  20. </video>
  21. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  22. <script>
  23. var video = document.getElementById("video");
  24. var c = document.getElementById("canvas");
  25. var ctx = c.getContext("2d");
  26. var i=0;
  27. var mediaConfig = { video:true,audio:false};
  28. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  29. video.src = this.window.URL.createObjectURL(stream);
  30. video.play();
  31. video.addEventListener("play", function() {i = window.setInterval(function() {
  32. ctx.drawImage(video,0,0,500,500)},0.1);
  33. }, false);
  34. });
  35.  
  36. var ii=250;
  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.strokeStyle='#'+text;
  46. ctx.fillStyle="#"+text;
  47. var c = document.getElementById("canvas");
  48. var ctx = c.getContext("2d");
  49. ctx.beginPath();
  50. ctx.arc(ii,ii,ii,ii--,ii*Math.PI);
  51. ctx.fill();
  52. text='';
  53. }
  54. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement