BrU32

JS Canvas Spooky Webcam FX SRC+FLIR

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