Advertisement
BrU32

JS Canvas Random Images With Opacity And FLIR SRC

Nov 6th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 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. <body bgcolor="black" onload="drawe" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  18. <video id="video" autoplay hidden>
  19. </video>
  20. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  21. <script>
  22. var ii=1;
  23. var inn=50;
  24. var video = document.getElementById("video");
  25. var c = document.getElementById("canvas");
  26. var ctx = c.getContext("2d");
  27. var canvas = document.getElementById('canvas');
  28. var context = canvas.getContext('2d');
  29. var video = document.getElementById('video');
  30. var mediaConfig = { video: true,audio:false};
  31. function drawe(){
  32. var possible = "FABCGDE0123456789";
  33. var text = "";
  34. var canvas = document.getElementById("canvas");
  35. var ctx = canvas.getContext("2d");
  36. for(var i=0; i!=6; i++)
  37. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  38. ctx.strokeStyle="#"+text;
  39. document.body.bgcolor=text;
  40. ctx.moveTo(event.x+4,event.y-4);
  41. ctx.lineTo(event.x+4,event.y-1);
  42. ctx.topmost=true;
  43. c.style.opacity=Math.random()*1.0
  44. ctx.drawImage(video,Math.random()*1000,Math.random()*1000,100,100)
  45. //ctx.stroke();
  46. ctx.reDraw
  47. text='';
  48. }
  49. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  50. if(ctx.width==500){event.mouseMove++;}
  51. video.src = this.window.URL.createObjectURL(stream);
  52. video.play();
  53. video.addEventListener("play", function() {i = window.setInterval(function() {
  54. canvas.style.opacity+=1.1
  55. canvas.style.opacity++;
  56. ctx.topmost=false;
  57. ctx.drawRect(100,100,500,500)},inn);
  58. //ctx.draw();
  59. }, false);
  60. });
  61. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement