Advertisement
BrU32

JS Canvas Cam JS/CSS Pretty As A Picture SRC FINAL

Dec 28th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:hue-rotate(34334deg);
  4. filter:contrast(24444444333%);
  5.  
  6. }
  7. canvas{
  8. filter:flip(18044);
  9. filter:invert(3443%);
  10. filter:saturate(1344%);
  11.  
  12.  
  13. }
  14. </style>
  15. <center>
  16. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  17. <video id="video" autoplay hidden>
  18. </video>
  19. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none; width:500px">
  20. <script>
  21. var ii=1;
  22.  
  23. var video = document.getElementById("video");
  24. var c = document.getElementById("canvas");
  25. var ctx = c.getContext("2d");
  26. var canvas = document.getElementById('canvas');
  27. var context = canvas.getContext('2d');
  28. var video = document.getElementById('video');
  29. var mediaConfig = { video: true,audio:true};
  30. function drawe(){
  31. var possible = "FABCGDE0123456789";
  32. var text = "";
  33. var canvas = document.getElementById("canvas");
  34. var ctx = canvas.getContext("2d");
  35. for(var i=0; i!=6; i++)
  36. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  37. ctx.fillStyle="#"+text;
  38. ctx.beginPath();
  39. ctx.fontStyle="Sans 300px"
  40. ctx.fillText(""+inn,event.x,event.y)
  41. ctx.fillRect(event.y,event.y,event.y,event.y,250*Math.PI)
  42. ctx.arc(event.x,event.x,event.y,event.y,250*Math.PI);
  43. ctx.fill();
  44. ctx.topmost=true;
  45. ctx.stroke();
  46. text='';
  47. }
  48. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  49. if(ctx.width==500){event.mouseMove++;}
  50. video.src = this.window.URL.createObjectURL(stream);
  51. video.play();
  52. video.addEventListener("play", function() {i = window.setInterval(function() {
  53. canvas.style.opacity=1.2
  54.  
  55. ctx.topmost=false;
  56. ctx.drawImage(video,1,1,500,500)},150);
  57. ctx.draw();
  58. drawe;
  59. }, false);
  60. });
  61. </script>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement