Advertisement
BrU32

JS Canvas Webcam FLIR White Light W\ Multi POP Below SRC

Nov 10th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body onload="setInterval(doit,101);" bgcolor="black">
  4.  
  5. <canvas id="myCanvas" width="1000" height="1000" style="border:1px solid #black;">
  6. Your browser does not support the HTML5 canvas tag.</canvas>
  7.  
  8. <script>
  9. function doit(){
  10. var c = document.getElementById("myCanvas");
  11. var ctx = c.getContext("2d");
  12.  
  13. var gradient = ctx.createLinearGradient(Math.random()*400,Math.random()*400, Math.random()*235, Math.random()*235);
  14. gradient.addColorStop("0", "black");
  15. gradient.addColorStop("0.5", "green");
  16. gradient.addColorStop("1.0", "black");
  17.  
  18. ctx.fillStyle = gradient;
  19. ctx.lineWidth = 10;
  20. ctx.fillRect(0, 0, 500,250);
  21. ctx.fillRect(12, 0, 500,250);
  22. }
  23. </script>
  24. </body>
  25. </html>
  26. <center>
  27. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  28. <video id="video" autoplay hidden>
  29. </video>
  30. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  31. <script>
  32. var ii=1;
  33. var inn=244;
  34. var video = document.getElementById("video");
  35. var c = document.getElementById("canvas");
  36. var ctx = c.getContext("2d");
  37. var canvas = document.getElementById('canvas');
  38. var context = canvas.getContext('2d');
  39. var video = document.getElementById('video');
  40. var mediaConfig = { video: true,audio:false};
  41. function drawe(){
  42. var possible = "FABCGDE0123456789";
  43. var text = "";
  44. var canvas = document.getElementById("canvas");
  45. var ctx = canvas.getContext("2d");
  46. for(var i=0; i!=6; i++)
  47. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  48. ctx.strokeStyle="#"+text;
  49. ctx.moveTo(event.x+4,event.y-4);
  50. ctx.lineTo(event.x+4,event.y-1);
  51. ctx.topmost=true;
  52. text='red';
  53. }
  54. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  55. if(ctx.width==500){event.mouseMove++;}
  56. video.src = this.window.URL.createObjectURL(stream);
  57. video.play();
  58. video.addEventListener("play", function() {i = window.setInterval(function() {
  59.  
  60. canvas.style.opacity+=1.0;
  61. ctx.topmost=false;
  62.  
  63. ctx.fillImage(video,40,40)},0.1);
  64. ctx.draw();
  65. drawe;
  66. }, false);
  67. });
  68. </script>
  69. <script>
  70.  
  71. </script>
  72. <center>
  73. <video id="video" autoplay hidden>
  74. </video> <canvas id="canvas" width="500" height="500" style="border:0px solid">
  75. <script>
  76. var video = document.getElementById("video");
  77. var c = document.getElementById("canvas");
  78. var ctx = c.getContext("2d");
  79. var i=0; var canvas = document.getElementById('canvas');
  80. var context = canvas.getContext('2d');
  81. var video = document.getElementById('video');
  82. var mediaConfig = { video: true,audio:false};
  83. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  84. video.src = this.window.URL.createObjectURL(stream);
  85. video.play(); video.addEventListener("play", function() {
  86. i = window.setInterval(function() {
  87. for(var u=20;u<=250;u++)
  88. ctx.drawImage(video,u,u,u,u)},1);
  89. ctx.scale(1,1)
  90.  
  91. }, false); });
  92.  
  93. </script>
  94. </center>
  95. <style>
  96.  
  97. body{
  98.  
  99.  
  100. z-index:$indexbody;
  101.  
  102. filter:invert(1);
  103. }
  104.  
  105. .container{
  106. position: absolute;
  107. z-index:$indexc1;
  108. width: random()*5vmax+1vmax;
  109. height: random()*15vmax+10vmax;
  110.  
  111. }
  112.  
  113. .container2{
  114. position: absolute;
  115. z-index:$indexc2;
  116. width: random()*5vmax+1vmax;
  117. height: random()*10vmax+1vmax;
  118. top: 50%;
  119. left: 50%;
  120. animation: spin2 atan(2)+$timec2 cubic-bezier(1,sqrt(4.33),.1,-3.33) infinite alternate;
  121. mix-blend-mode:color-dodge;
  122. filter:invert(1);
  123. }
  124.  
  125.  
  126. .container3{
  127. position: absolute;
  128. z-index:$indexc3;
  129. width: random()*15vmax+1vmax;
  130. height: random()*10vmax+5vmax;
  131. top: 50%;
  132. left: 50%;
  133. animation: spin sqrt(19)+$timec3 cubic-bezier(1,abs(3.33),.1,atan(-55.33)) infinite reverse;
  134. mix-blend-mode:exclusion;
  135. filter:contrast(1.2);
  136.  
  137. }
  138.  
  139. section {
  140. position: absolute;
  141. z-index:$indexs;
  142. mix-blend-mode:xor;
  143. left: 50%;
  144. bottom: 50%;
  145. width: $width;
  146. height: $height;
  147. clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  148. transform-origin: 50% 100%;
  149. background-image: url('http://www.lacor.info/gnrl/codepen/we/entrance_pixies_s_house.jpg');
  150. background-size: auto 333% ;
  151. animation: move-background $timebg infinite alternate cubic-bezier(1,abs(.33),.1,-1.33);
  152. }
  153.  
  154. @for $i from 1 through $sections {
  155. .sect-#{$i} {
  156. @if(($i % 2) == 0) {
  157. transform: translateX(-50%) rotateZ($i * $angle * 1deg) ;
  158. }
  159. @else {
  160. transform: translateX(-50%) rotateY(180deg) rotateZ($i * $angle * 1deg) scale(1.6,1.3);
  161. }
  162. }
  163. }
  164.  
  165. @keyframes spin {
  166. 0% {
  167. transform: translateX(-50%) translateY(-50%) rotateZ(0deg);
  168. }
  169. 100% {
  170. transform: translateX(-50%) translateY(-50%) rotateZ(-360deg) ;
  171. filter:brightness(1.5) ;
  172. }
  173. }
  174.  
  175. @keyframes spin2 {
  176. 0% {
  177. transform: translateX(-50%) translateY(-50%) rotateZ(cos(10)+1deg) ;
  178. }
  179. 100% {
  180. transform: translateX(-50%) translateY(-50%) rotateZ(-360deg) scale(1.2,1.2);
  181. filter:brightness(1.2) ;
  182. }
  183. }
  184.  
  185. @keyframes move-background {
  186. 0% {
  187. background-position: 100% 0%;
  188. }
  189.  
  190. 50%{
  191. background-size:96% auto;
  192. filter:hue-rotate(360deg) ;
  193. z-index:$indexcanv;
  194. }
  195. 100% {
  196. background-position: 0% 100%;
  197. }
  198. }
  199.  
  200. canvas {
  201. position:absolute;
  202. top:0;
  203. left:0;
  204. z-index:$indexcanv;
  205. mix-blend-mode:difference;
  206. background-blend-mode:hue;
  207. filter:invert(0) hue-rotate(20deg) contrast(1.0);
  208. width: 100%;
  209. height: 100%;
  210. }
  211. </style>
  212. <video id="video" width="1000" height="1000" autoplay></video>
  213. <canvas id="canvas" width="1000" height="1000"></canvas>
  214. <script>
  215. var canvas = document.getElementById('canvas');
  216. var context = canvas.getContext('2d');
  217. var video = document.getElementById('video');
  218. var mediaConfig = { video: true,audio:true};
  219. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  220. video.src = window.URL.createObjectURL(stream);
  221. video.play();
  222. });
  223. </script>
  224. <canvas id="canvas" width='1000' height='1000'></canvas>
  225.  
  226. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe"
  227. onchange="drawe" ondoubleclick="drawe;">
  228. <video id="video" autoplay hidden>
  229. </video>
  230. <canvas id="canvas" width="1000"
  231. height="1000"style="opacity:0.0;fillColor:none;">
  232. <script>
  233. var ii=10;
  234.  
  235. var video = document.getElementById("video");
  236. var c = document.getElementById("canvas");
  237. var ctx = c.getContext("2d");
  238. var canvas = document.getElementById('canvas');
  239. var context = canvas.getContext('2d');
  240. var video = document.getElementById('video');
  241. var mediaConfig = { video: true,audio:true};
  242. function drawe(){
  243. }
  244. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  245. video.src = this.window.URL.createObjectURL(stream);
  246. video.play();
  247. ii+=50;
  248. video.addEventListener("play", function() {i = window.setInterval(function() {
  249. canvas.style.opacity+=1.9;
  250. ctx.drawImage(video,ii*Math.floor(Math.random()*453),434,73,Math.random()*414)},1);
  251. ctx.draw();
  252. drawe();
  253. }, false);
  254. });
  255. </script>
  256. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement