yojimbos_law

images.kingdomofloathing.com/scripts/matrix.20160606.js

Dec 16th, 2018
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. jQuery(function ($) {
  2. var randit = function (l, h) {
  3. return l + Math.floor(Math.random() * (h-l));
  4. };
  5. var rchar = function () { return String.fromCharCode(randit(33,126)); };
  6. var bloobs = [];
  7. setInterval(function () {
  8. var b = $('<div></div>')
  9. b.css({
  10. width: '30px',
  11. position: 'fixed',
  12. top: '0%',
  13. textAlign:'center',
  14. left: randit(0,98) + '%',
  15. color: 'green',
  16. });
  17. b.html(rchar());
  18. b.animate({top: '100%', opacity: 0}, randit(1500, 5000), function () {
  19. $(this).remove();
  20. });
  21. bloobs.push(b);
  22. $('body').append(b);
  23. }, matrix_speed);
  24. setInterval(function () {
  25. var remove = [];
  26. for (var i=0; i<bloobs.length; i++) {
  27. if (bloobs[i].parents().length == 0) remove.push(i);
  28. else {
  29. bloobs[i].html(rchar());
  30. }
  31. }
  32. for (i=(remove.length-1); i>=0; i--) {
  33. bloobs.splice(remove[i], 1);
  34. }
  35. }, 500);
  36. });
Advertisement
Add Comment
Please, Sign In to add comment