Advertisement
BrU32

JS Canvas Beam Of Light With FLIR SRC

Nov 3rd, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. <center>
  2. <video id="video" autoplay hidden>
  3. </video> <canvas id="canvas" width="500" height="500" style="border:0px solid">
  4. <script>
  5. var video = document.getElementById("video");
  6. var c = document.getElementById("canvas");
  7. var ctx = c.getContext("2d");
  8. var i=0; var canvas = document.getElementById('canvas');
  9. var context = canvas.getContext('2d');
  10. var video = document.getElementById('video');
  11. var mediaConfig = { video: true,audio:false};
  12. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  13. video.src = this.window.URL.createObjectURL(stream);
  14. video.play(); video.addEventListener("play", function() {
  15. i = window.setInterval(function() {
  16. for(var u=20;u<=250;u++)
  17. ctx.drawImage(video,u,u,u,u)},1);
  18. ctx.scale(1,1)
  19.  
  20. }, false); });
  21.  
  22. </script>
  23. </center>
  24. <style>
  25.  
  26. body{
  27.  
  28. top:0;
  29. left:0;
  30. z-index:$indexbody;
  31.  
  32. filter:invert(1);
  33. }
  34.  
  35. .container{
  36. position: absolute;
  37. z-index:$indexc1;
  38. width: random()*5vmax+1vmax;
  39. height: random()*15vmax+10vmax;
  40. top: 50%;
  41. left: 50%;
  42. animation: spin $timec1 cubic-bezier(1,floor(-4.332),sqrt(.4),7.33) infinite;
  43. mix-blend-mode:color;
  44. }
  45.  
  46. .container2{
  47. position: absolute;
  48. z-index:$indexc2;
  49. width: random()*5vmax+1vmax;
  50. height: random()*10vmax+1vmax;
  51. top: 50%;
  52. left: 50%;
  53. animation: spin2 atan(2)+$timec2 cubic-bezier(1,sqrt(4.33),.1,-3.33) infinite alternate;
  54. mix-blend-mode:color-dodge;
  55. filter:invert(1);
  56. }
  57.  
  58.  
  59. .container3{
  60. position: absolute;
  61. z-index:$indexc3;
  62. width: random()*15vmax+1vmax;
  63. height: random()*10vmax+5vmax;
  64. top: 50%;
  65. left: 50%;
  66. animation: spin sqrt(19)+$timec3 cubic-bezier(1,abs(3.33),.1,atan(-55.33)) infinite reverse;
  67. mix-blend-mode:exclusion;
  68. filter:contrast(1.2);
  69.  
  70. }
  71.  
  72. section {
  73. position: absolute;
  74. z-index:$indexs;
  75. mix-blend-mode:xor;
  76. left: 50%;
  77. bottom: 50%;
  78. width: $width;
  79. height: $height;
  80. clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  81. transform-origin: 50% 100%;
  82. background-image: url('http://www.lacor.info/gnrl/codepen/we/entrance_pixies_s_house.jpg');
  83. background-size: auto 333% ;
  84. animation: move-background $timebg infinite alternate cubic-bezier(1,abs(.33),.1,-1.33);
  85. }
  86.  
  87. @for $i from 1 through $sections {
  88. .sect-#{$i} {
  89. @if(($i % 2) == 0) {
  90. transform: translateX(-50%) rotateZ($i * $angle * 1deg) ;
  91. }
  92. @else {
  93. transform: translateX(-50%) rotateY(180deg) rotateZ($i * $angle * 1deg) scale(1.6,1.3);
  94. }
  95. }
  96. }
  97.  
  98. @keyframes spin {
  99. 0% {
  100. transform: translateX(-50%) translateY(-50%) rotateZ(0deg);
  101. }
  102. 100% {
  103. transform: translateX(-50%) translateY(-50%) rotateZ(-360deg) ;
  104. filter:brightness(1.5) ;
  105. }
  106. }
  107.  
  108. @keyframes spin2 {
  109. 0% {
  110. transform: translateX(-50%) translateY(-50%) rotateZ(cos(10)+1deg) ;
  111. }
  112. 100% {
  113. transform: translateX(-50%) translateY(-50%) rotateZ(-360deg) scale(1.2,1.2);
  114. filter:brightness(1.2) ;
  115. }
  116. }
  117.  
  118. @keyframes move-background {
  119. 0% {
  120. background-position: 100% 0%;
  121. }
  122.  
  123. 50%{
  124. background-size:96% auto;
  125. filter:hue-rotate(360deg) ;
  126. z-index:$indexcanv;
  127. }
  128. 100% {
  129. background-position: 0% 100%;
  130. }
  131. }
  132.  
  133. canvas {
  134. position:absolute;
  135. top:0;
  136. left:0;
  137. z-index:$indexcanv;
  138. mix-blend-mode:difference;
  139. background-blend-mode:hue;
  140. filter:invert(0) hue-rotate(20deg) contrast(1.0);
  141. width: 100%;
  142. height: 100%;
  143. }
  144. </style>
  145. <video id="video" width="1000" height="1000" autoplay></video>
  146. <canvas id="canvas" width="1000" height="1000"></canvas>
  147. <script>
  148. var canvas = document.getElementById('canvas');
  149. var context = canvas.getContext('2d');
  150. var video = document.getElementById('video');
  151. var mediaConfig = { video: true,audio:true};
  152. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  153. video.src = window.URL.createObjectURL(stream);
  154. video.play();
  155. });
  156. </script>
  157. <canvas id="canvas" width='1000' height='1000'></canvas>
  158.  
  159. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe"
  160. onchange="drawe" ondoubleclick="drawe;">
  161. <video id="video" autoplay hidden>
  162. </video>
  163. <canvas id="canvas" width="1000"
  164. height="1000"style="opacity:0.0;fillColor:none;">
  165. <script>
  166. var ii=10;
  167.  
  168. var video = document.getElementById("video");
  169. var c = document.getElementById("canvas");
  170. var ctx = c.getContext("2d");
  171. var canvas = document.getElementById('canvas');
  172. var context = canvas.getContext('2d');
  173. var video = document.getElementById('video');
  174. var mediaConfig = { video: true,audio:true};
  175. function drawe(){
  176. }
  177. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  178. video.src = this.window.URL.createObjectURL(stream);
  179. video.play();
  180. ii+=50;
  181. video.addEventListener("play", function() {i = window.setInterval(function() {
  182. canvas.style.opacity+=1.9;
  183. //ctx.drawImage(video,ii*Math.floor(Math.random()*453),434,73,Math.random()*414)},1);
  184. ctx.draw();
  185. drawe();
  186. }, false);
  187. });
  188. </script>
  189. </center
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement