Advertisement
Guest User

Custom code

a guest
Feb 25th, 2022
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. <script>
  2. $(".meter > span").each(function () {
  3. $(this)
  4. .data("origWidth", $(this).width())
  5. .width(0)
  6. .animate(
  7. {
  8. width: $(this).data("origWidth")
  9. },
  10. 1200
  11. );
  12. });
  13. </script>
  14.  
  15. <style>
  16. .meter {
  17. box-sizing: content-box;
  18. height: 20px; /* Can be anything */
  19. position: relative;
  20. margin: 60px 0 20px 0; /* Just for demo spacing */
  21. background: #555;
  22. border-radius: 25px;
  23. padding: 10px;
  24. box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
  25. }
  26. .meter > span {
  27. display: block;
  28. height: 100%;
  29. border-top-right-radius: 8px;
  30. border-bottom-right-radius: 8px;
  31. border-top-left-radius: 20px;
  32. border-bottom-left-radius: 20px;
  33. background-color: rgb(43, 194, 83);
  34. background-image: linear-gradient(
  35. center bottom,
  36. rgb(43, 194, 83) 37%,
  37. rgb(84, 240, 84) 69%
  38. );
  39. box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3),
  40. inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  41. position: relative;
  42. overflow: hidden;
  43. }
  44. .meter > span:after,
  45. .animate > span > span {
  46. content: "";
  47. position: absolute;
  48. top: 0;
  49. left: 0;
  50. bottom: 0;
  51. right: 0;
  52. background-image: linear-gradient(
  53. -45deg,
  54. rgba(255, 255, 255, 0.2) 25%,
  55. transparent 25%,
  56. transparent 50%,
  57. rgba(255, 255, 255, 0.2) 50%,
  58. rgba(255, 255, 255, 0.2) 75%,
  59. transparent 75%,
  60. transparent
  61. );
  62. z-index: 1;
  63. background-size: 50px 50px;
  64. animation: move 2s linear infinite;
  65. border-top-right-radius: 8px;
  66. border-bottom-right-radius: 8px;
  67. border-top-left-radius: 20px;
  68. border-bottom-left-radius: 20px;
  69. overflow: hidden;
  70. }
  71.  
  72. .animate > span:after {
  73. display: none;
  74. }
  75.  
  76. @keyframes move {
  77. 0% {
  78. background-position: 0 0;
  79. }
  80. 100% {
  81. background-position: 50px 50px;
  82. }
  83. }
  84.  
  85. .orange > span {
  86. background-image: linear-gradient(#f1a165, #f36d0a);
  87. }
  88.  
  89. .red > span {
  90. background-image: linear-gradient(#f0a3a3, #f42323);
  91. }
  92.  
  93. .nostripes > span > span,
  94. .nostripes > span::after {
  95. background-image: none;
  96. }
  97.  
  98. * {
  99. box-sizing: border-box;
  100. }
  101. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement