Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <script>
  2. $(function() {
  3. var online;
  4. document.getElementById('online1').innerHTML='';var temp_date=new Date();var hours=temp_date.getHours();if(hours<1)
  5. {online=Math.floor(Math.random()*(7700-7500+1))+7500;}else
  6. if(hours<2)
  7. {online=Math.floor(Math.random()*(7300-7100+1))+7100;}else
  8. if(hours<3)
  9. {online=Math.floor(Math.random()*(6500-6300+1))+6300;}else
  10. if(hours<4)
  11. {online=Math.floor(Math.random()*(5800-5600+1))+5600;}else
  12. if(hours<9)
  13. {online=Math.floor(Math.random()*(4700-4500+1))+4500;}else
  14. if(hours<12)
  15. {online=Math.floor(Math.random()*(6100-5800+1))+5800;}else
  16. if(hours<15)
  17. {online=Math.floor(Math.random()*(7000-6800+1))+6800;}else
  18. if(hours<20)
  19. {online=Math.floor(Math.random()*(7900-7700+1))+7700;}else
  20. if(hours>=20)
  21. {online=Math.floor(Math.random()*(8300-8100+1))+8100;}
  22. document.getElementById('online1').innerHTML=online;
  23.  
  24.  
  25. var online1,online2,online3;
  26. var startColor = '#7fc51a';
  27. var endColor = 'rgba(255,123,0,1)';
  28. var optsGradient = {
  29. from: { color: startColor},
  30. to: { color: endColor}
  31. };
  32. var optsBar = {
  33. color: startColor,
  34. strokeWidth: 12.25,
  35. trailWidth: 0,
  36. duration: 0,
  37. easing: 'linear',
  38. text: {
  39. value: "",
  40. autoStyle: false
  41. }
  42. };
  43. var optsBarGradient = {
  44. color: startColor,
  45. strokeWidth: 12.25,
  46. trailWidth: 0,
  47. duration: 0,
  48. easing: 'linear',
  49. text: {
  50. value: "",
  51. autoStyle: false
  52. },
  53. // Set default step function for all animate calls
  54. step: function(state, circle) {
  55. circle.path.setAttribute('stroke', state.color);
  56. }
  57. };
  58.  
  59. //online1 = document.getElementById('online1').innerText / 100 / 100;
  60. online = online / 100 / 100;
  61. var first = new ProgressBar.Circle('#progressbar-first', optsBar);
  62. first.animate(online, function() {first.animate(online);});
  63.  
  64. var second = new ProgressBar.Circle('#progressbar-second', optsBar);
  65. second.animate(online2, function() {second.animate(online2);});
  66.  
  67. var third = new ProgressBar.Circle('#progressbar-third', optsBar);
  68. third.animate(online3, function() {third.animate(online3);});
  69. });
  70. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement