Advertisement
BrU32

JS Canvas Webcam Boy In The Rainbow Bubble Effect SRC

Sep 23rd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. <center>
  2. <body onload="setInterval(drawe,2)" background-color="white">
  3. <video id="video" autoplay hidden>
  4. </video>
  5. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  6. <script>
  7. var video = document.getElementById("video");
  8. var c = document.getElementById("canvas");
  9. var ctx = c.getContext("2d");
  10. var i=0;
  11. var mediaConfig = { video:true,audio:true};
  12. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  13. video.src = this.window.URL.createObjectURL(stream);
  14. video.play();
  15. video.addEventListener("play", function() {i = window.setInterval(function() {
  16. ctx.drawImage(video,0,0,500,500)},0.1);
  17. }, false);
  18. });
  19.  
  20. var ii=250;
  21. function drawe(){
  22. ii++;
  23. var text = "";
  24. var possible = "FABCGDE0123456789";
  25. var canvas = document.getElementById("canvas");
  26. var ctx = canvas.getContext("2d");
  27. for(var i=0; i!=6; i++)
  28. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  29. ctx.strokeStyle='#'+text;
  30. ctx.fillStyle="#"+text;
  31. var c = document.getElementById("canvas");
  32. var ctx = c.getContext("2d");
  33. ctx.beginPath();
  34. ctx.arc(ii,ii,ii,ii--,ii*Math.PI);
  35. ctx.fill();
  36. text='';
  37. }
  38. </script>
  39. //JS Canvas Resizeable Webcam Canvas Boy In Bubble SRC:
  40.  
  41. <center>
  42. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  43. <video id="video" autoplay hidden>
  44. </video>
  45. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  46. <script>
  47. var ii=1;
  48. var video = document.getElementById("video");
  49. var c = document.getElementById("canvas");
  50. var ctx = c.getContext("2d");
  51. var canvas = document.getElementById('canvas');
  52. var context = canvas.getContext('2d');
  53. var video = document.getElementById('video');
  54. var mediaConfig = { video: true,audio:false};
  55. function drawe(){
  56. var possible = "FABCGDE0123456789";
  57. var text = "";
  58. var canvas = document.getElementById("canvas");
  59. var ctx = canvas.getContext("2d");
  60. for(var i=0; i!=6; i++)
  61. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  62. ctx.fillStyle="#"+text;
  63. ctx.beginPath();
  64. ctx.arc(event.x,event.y,event.y,event.y,250*Math.PI);
  65. ctx.fill();
  66. ctx.topmost=true;
  67. ctx.stroke();
  68. //text='';
  69. }
  70. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  71. if(ctx.width==500){event.mouseMove++;}
  72. video.src = this.window.URL.createObjectURL(stream);
  73. video.play();
  74. video.addEventListener("play", function() {i = window.setInterval(function() {
  75. canvas.style.opacity-=0.1
  76. canvas.style.opacity++;
  77. ctx.topmost=false;
  78. ctx.drawImage(video,1,1,500,500)},100);
  79. ctx.draw();
  80. drawe;
  81. }, false);
  82. });
  83. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement