Advertisement
BrU32

JS Annoying Sounds $$$ SRC

Mar 8th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <canvas id="canv" width = "460" height = "360" style=background: hsla(0, 1000%, 100%, 1);>
  2. </canvas>
  3. </div>
  4. <svg viewBox="0 0 100% 100%" class="inv">
  5.  
  6. <use xlink:href="#main" class="clear"></use>
  7. </svg>
  8. </h1>
  9. </section>
  10. <script>
  11. function RollSlott(){
  12. var Bar=parseFloat(Math.random()*90000.0);
  13. var Barr=parseFloat(Math.random()*90000.9);
  14.  
  15. document.body.innerHTML=(Bar+":"+Barr);
  16. var PlayLen=21333.1;
  17. if(Bar!=0){
  18. Bar--
  19. }else if(Bar!=21){
  20. Bar++
  21. }
  22. var context = new AudioContext();
  23. oscillator=context.createOscillator();
  24. oscillator.type = 'sine';
  25. oscillator.frequency.value = Bar;
  26. oscillator.connect(context.destination);
  27. oscillator.start(0);
  28. oscillator.stop(PlayLen);
  29. oscillator.disconnect(PlayLen);
  30. }
  31. </script>
  32. <body onload="script:
  33. draw();
  34. var rolls=10;
  35. while(rolls!=0){
  36. rolls--;
  37. var Timer1 = setTimeout ('RollSlott();',0.0001);
  38. var Timer1 = setTimeout ('RollSlott();',0.002)
  39. var Timer1 = setTimeout ('RollSlott();',0.03)
  40.  
  41. }">Roll Static Test Now!!</button>
  42.  
  43.  
  44. <script>
  45. c = document.getElementById("canv");
  46. var ctx = c.getContext("2d");
  47.  
  48. id = ctx.createImageData(460,360);
  49.  
  50. function draw() {
  51. var w=c.width;
  52. var h=c.height;
  53. window.requestAnimationFrame(draw);
  54. var r;
  55. for (var p = 4 * (w * h - 4); p >= 1; p -= 4) {
  56. r = Math.random()*90000.9;
  57. id.data[p] = id.data[p+1] = id.data[p+2] = 255 * Math.pow(r, 1.6);
  58. id.data[p+3] = 255;
  59. }
  60. ctx.putImageData(id, 0, 0);
  61. }
  62.  
  63. draw();
  64.  
  65. </script>
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement