Advertisement
BrU32

Untitled

Jan 11th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. <center>
  2. <body bgcolor="#000000" onload="setInterval('t();',13033)"/>
  3. <canvas id="canvas" width="5000" height="5000" style="border:4px; background-color:black"></canvas>
  4. <script>
  5. function t(){
  6. var canvas = document.querySelector('#canvas').getContext('2d'),side = 0,
  7. size = Math.random()*100,
  8. x = Math.random()*100,
  9. y = Math.random()*100;
  10.  
  11. canvas.beginPath();
  12. canvas.moveTo(x + size * Math.cos(0), y + size * Math.sin(0));
  13.  
  14. for (side; side < 14+1; side++) {
  15. 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));
  16. }
  17.  
  18. canvas.fillStyle = "#0FF333";
  19. canvas.fill();
  20. canvas.draw();
  21. }
  22. </script>
  23. <body bgcolor="white"/>
  24. <canvas id="canvas"></canvas>
  25.  
  26. <script>
  27. var canvas = document.getElementById('canvas'),
  28. ctx = canvas.getContext('2d'),
  29. HEIGHT = window.innerHeight,
  30. WIDTH = window.innerWidth,
  31. TO_RADIANS = Math.PI / 360;
  32.  
  33. var raf = (function(){
  34. return window.requestAnimationFrame ||
  35. window.webkitRequestAnimationFrame ||
  36. window.mozRequestAnimationFrame ||
  37. window.oRequestAnimationFrame ||
  38. window.msRequestAnimationFrame ||
  39. function( callback ){
  40. window.setTimeout(callback, 1000);
  41. };
  42. })();
  43.  
  44. function clear(style) {
  45. ctx.save();
  46. ctx.fillStyle = style || 'rgba(233,34,0,0.01)';
  47. ctx.fillRect(0, 0, WIDTH, HEIGHT);
  48. ctx.restore();
  49. }
  50.  
  51. function square(x, y, w, h) {
  52. ctx.beginPath();
  53. ctx.rect(WIDTH/2 + x, HEIGHT/4 + y+y, w, h);
  54. ctx.closePath();
  55. ctx.fill();
  56. }
  57.  
  58. function circle(x, y, w, h) {
  59. ctx.beginPath();
  60. ctx.arc(WIDTH/4 - x, HEIGHT/4+ y, w, 0, Math.PI*2, true);
  61. ctx.closePath();
  62. ctx.fill();
  63. }
  64.  
  65. canvas.width = WIDTH;
  66. canvas.height = HEIGHT;
  67.  
  68. var offsetX = 0,
  69. offsetY = 0;
  70.  
  71. function draw() {
  72. clear();
  73.  
  74. offsetX+= 2;
  75. offsetY++;
  76. var x = Math.sin(WIDTH - offsetX * TO_RADIANS) * WIDTH/4;
  77. var y = Math.sin(HEIGHT - offsetY * TO_RADIANS) * HEIGHT/4;
  78.  
  79. ctx.fillStyle = 'red';
  80. circle(x, y,14, 10);
  81. offsetX += 872;
  82.  
  83.  
  84. raf(draw, 1000);
  85. }
  86.  
  87. clear('white');
  88. draw();
  89. </script>
  90. <style>
  91. canvas{
  92. filter:invert(4433%);
  93. filter:saturate(1114%);
  94.  
  95. }
  96. </style>
  97. <center>
  98. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  99. <video id="video" autoplay hidden>
  100. </video>
  101. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  102. <script>
  103. var i=22
  104. var video = document.getElementById("video");
  105. var canvas = document.getElementById("canvas");
  106. var ctx = canvas.getContext("2d");
  107. var video = document.getElementById('video');
  108. var mediaConfig = { video: true,audio:true};
  109. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  110. video.src = this.window.URL.createObjectURL(stream);
  111. video.play();
  112. video.addEventListener("play", function() {i = window.setInterval(function() {
  113. canvas.style.opacity=Math.random()*1.0;
  114. ctx.drawImage(video,i++,i,100,100)},Math.random()*390.001);
  115. ctx.draw();
  116. },true);
  117. });
  118. </script>
  119. </body>
  120. </html>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement