BrU32

JS Webcam Kool Rendering FX FINAL

Jan 12th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. <style>
  2. body{
  3. overflow: visible;
  4. position:center;
  5. filter:saturation:(222);
  6. filter:invert(1.0);
  7. }
  8. .container{
  9. position: center;
  10. width: Math.random()*5vmax+1vmax;
  11. height: Math.random()*15vmax+10vmax;
  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;">
  20. <script>
  21. var ii=1;
  22. var video = document.getElementById("video");
  23. var c = document.getElementById("canvas");
  24. var ctx = c.getContext("2d");
  25. var canvas = document.getElementById('canvas');
  26. var context = canvas.getContext('2d');
  27. var video = document.getElementById('video');
  28. var mediaConfig = { video: true,audio:false};
  29. function drawe(){
  30. var possible = "FABCGDE0123456789";
  31. var text = "";
  32. var canvas = document.getElementById("canvas");
  33. var ctx = canvas.getContext("2d");
  34. for(var i=0; i!=6; i++)
  35. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  36. ctx.fillStyle="#"+text;
  37. ctx.beginPath();
  38. ctx.arc(event.x,event.x,event.x,event.x,event.y);
  39. ctx.fill();
  40. ctx.topmost=true;
  41. ctx.stroke();
  42. //text='';
  43. }
  44. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  45. if(ctx.width==500){event.mouseMove++;}
  46. video.src = this.window.URL.createObjectURL(stream);
  47. video.play();
  48. video.addEventListener("play", function() {i = window.setInterval(function() {
  49. canvas.style.opacity-=0.1
  50. canvas.style.opacity++;
  51. ctx.topmost=false;
  52. ctx.drawImage(video,0,1,500,500)},1000);
  53. 0
  54. drawe;
  55. }, false);
  56. });
  57. </script>
  58. <center>
  59. <body bgcolor="#000000" onload="setInterval('t();',13033)"/>
  60. <canvas id="canvas" width="5000" height="5000" style="border:4px; background-color:black"></canvas>
  61. <script>
  62. function t(){
  63. var canvas = document.querySelector('#canvas').getContext('2d'),side = 0,
  64. size = Math.random()*100,
  65. x = Math.random()*100,
  66. y = Math.random()*100;
  67.  
  68. canvas.beginPath();
  69. canvas.moveTo(x + size * Math.cos(0), y + size * Math.sin(0));
  70.  
  71. for (side; side < 14+1; side++) {
  72. canvas.lineTo(x+Math.floor(Math.random()*8) + Math.random()*Math.sqrt(3339) * Math.cos(side * 6 * Math.PI / 14), y + size * Math.sin(side * 8 * Math.PI / 14));
  73. }
  74.  
  75. canvas.fillStyle = "#0FF333";
  76. canvas.fill();
  77. canvas.draw();
  78. }
  79. </script>
  80. <body bgcolor="white"/>
  81. <canvas id="canvas"></canvas>
  82.  
  83. <script>
  84. var canvas = document.getElementById('canvas'),
  85. ctx = canvas.getContext('2d'),
  86. HEIGHT = window.innerHeight,
  87. WIDTH = window.innerWidth,
  88. TO_RADIANS = Math.PI / 360;
  89.  
  90. var raf = (function(){
  91. return window.requestAnimationFrame ||
  92. window.webkitRequestAnimationFrame ||
  93. window.mozRequestAnimationFrame ||
  94. window.oRequestAnimationFrame ||
  95. window.msRequestAnimationFrame ||
  96. function( callback ){
  97. window.setTimeout(callback, 1000);
  98. };
  99. })();
  100.  
  101. function clear(style) {
  102. ctx.save();
  103. ctx.fillStyle = style || 'rgba(233,34,0,0.01)';
  104. ctx.fillRect(0, 0, WIDTH, HEIGHT);
  105. ctx.restore();
  106. }
  107.  
  108. function square(x, y, w, h) {
  109. ctx.beginPath();
  110. ctx.rect(WIDTH/2 + x, HEIGHT/4 + y+y, w, h);
  111. ctx.closePath();
  112. ctx.fill();
  113. }
  114.  
  115. function circle(x, y, w, h) {
  116. ctx.beginPath();
  117. ctx.arc(WIDTH/4 - x, HEIGHT/4+ y, w, 0, Math.PI*2, true);
  118. ctx.closePath();
  119. ctx.fill();
  120. }
  121.  
  122. canvas.width = WIDTH;
  123. canvas.height = HEIGHT;
  124.  
  125. var offsetX = 0,
  126. offsetY = 0;
  127.  
  128. function draw() {
  129. clear();
  130.  
  131. offsetX+= 2;
  132. offsetY++;
  133. var x = Math.sin(WIDTH - offsetX * TO_RADIANS) * WIDTH/4;
  134. var y = Math.sin(HEIGHT - offsetY * TO_RADIANS) * HEIGHT/4;
  135.  
  136. ctx.fillStyle = ;
  137. circle(x, y,14, 10);
  138. offsetX += 872;
  139.  
  140. 0
  141. raf(draw, 1000);
  142. }
  143.  
  144. clear('white');
  145. draw();
  146. </script>
  147. <style>
  148. canvas{
  149. filter:invert(433%);
  150. filter:saturate(1114%);
  151.  
  152. }
  153. </style>
  154. <center>
  155. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  156. <video id="video" autoplay hidden>
  157. </video>
  158. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  159. <script>
  160. var i=22
  161. var video = document.getElementById("video");
  162. var canvas = document.getElementById("canvas");
  163. var ctx = canvas.getContext("2d");
  164. var video = document.getElementById('video');
  165. var mediaConfig = { video: true,audio:true};
  166. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  167. video.src = this.window.URL.createObjectURL(stream);
  168. video.play();
  169. video.addEventListener("play", function() {i = window.setInterval(function() {
  170. ctx.drawImage(video,i,i,500,500)},Math.random()*1000);
  171. ctx.draw();
  172. },true);
  173. });
  174. </script>
  175. </body>
  176. </html>>
  177. </body>
  178. </html>
Advertisement
Add Comment
Please, Sign In to add comment