Advertisement
BrU32

JS Rainbow Cam Swiss Cheese Edition W\ FLIR FX

Mar 5th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:invert(180%);
  4. }
  5. </style>
  6. <center>
  7. <body onload="setInterval(drawe,10)" background-color="white">
  8. <video id="video" autoplay hidden>
  9. </video>
  10. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  11. <script>
  12. var video = document.getElementById("video");
  13. var c = document.getElementById("canvas");
  14. var ctx = c.getContext("2d");
  15. var i=0;
  16. var mediaConfig = { video:true,audio:false};
  17. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  18. video.src = this.window.URL.createObjectURL(stream);
  19. video.play();
  20. video.addEventListener("play", function() {i = window.setInterval(function() {
  21. ctx.drawImage(video,0,0,Math.random()*500,Math.random()*500)},10.1);
  22. }, false);
  23. });
  24.  
  25. var ii=250;
  26. function drawe(){
  27. ii++;
  28. var text = "";
  29. var possible = "FABCGDE0123456789";
  30. var canvas = document.getElementById("canvas");
  31. var ctx = canvas.getContext("2d");
  32. for(var i=0; i!=6; i++)
  33. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  34. ctx.strokeStyle='#'+text;
  35. ctx.fillStyle="#"+text;
  36. var c = document.getElementById("canvas");
  37. var ctx = c.getContext("2d");
  38. ctx.beginPath();
  39. ctx.arc(Math.random()*ii,Math.random()*ii,Math.random()*ii,Math.random()*ii,Math.random()*ii*Math.PI++);
  40. ctx.fill();
  41. text='';
  42. }
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement