Advertisement
BrU32

JS Kool Cam Bro

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