Css прогресс бар красивый

Содержание
  1. Circle progress bar with pure CSS and HTML
  2. Setup
  3. Option 1
  4. Option 2
  5. Conic gradient
  6. Showing the percentage
  7. Animation
  8. Conclusion
  9. 39 CSS Progress Bars
  10. Related Articles:
  11. Author
  12. Links
  13. Made with
  14. About a code
  15. 3D Circular Progress Bar
  16. Author
  17. Links
  18. Made with
  19. About a code
  20. Animated Skill Meter
  21. Author
  22. Links
  23. Made with
  24. About a code
  25. Progress Bar
  26. Author
  27. Links
  28. Made with
  29. About a code
  30. Custom Properties Step Progress Indicator
  31. Author
  32. Links
  33. Made with
  34. About a code
  35. Glitchy Progress Display
  36. Author
  37. Links
  38. Made with
  39. About a code
  40. Progress Bar Animation #2
  41. Author
  42. Links
  43. Made with
  44. About a code
  45. Circular Progress Bar
  46. Author
  47. Links
  48. Made with
  49. About a code
  50. Progress Bars
  51. Author
  52. Links
  53. Made with
  54. About a code
  55. CSS-Only Animated Progress Bars
  56. Author
  57. Links
  58. Made with
  59. About a code
  60. The Progress
  61. Author
  62. Links
  63. Made with
  64. About a code
  65. Progress
  66. Author
  67. Links
  68. Made with
  69. About a code
  70. Purple Progress Bar
  71. Author
  72. Links
  73. Made with
  74. About a code
  75. Pixel Progress Bar
  76. Author
  77. Links
  78. Made with
  79. About a code
  80. Color Changing Loading Progress Bar
  81. Author
  82. Links
  83. Made with
  84. About a code
  85. SVG Circle Progress Bar
  86. Author
  87. Links
  88. Made with
  89. About a code
  90. SVG Circle Progress Bar
  91. Author
  92. Links
  93. Made with
  94. About a code
  95. CSS Circular Progress
  96. Author
  97. Links
  98. Made with
  99. About a code
  100. Warning Bar
  101. Author
  102. Links
  103. Made with
  104. About a code
  105. Progress Scrollbar CSS Only
  106. Author
  107. Links
  108. Made with
  109. About a code
  110. Simple Progress Bar
  111. Author
  112. Links
  113. Made with
  114. About a code
  115. Only CSS Loading Animation
  116. Author
  117. Links
  118. Made with
  119. About the code
  120. Progress Bar Pure CSS
  121. Author
  122. Links
  123. Made with
  124. About the code
  125. Animation Progress Bars
  126. Author
  127. Links
  128. Made with
  129. About the code
  130. CSS Progress Bars
  131. Author
  132. Links
  133. Made with
  134. About the code
  135. Stepped Progress Bar
  136. Author
  137. Links
  138. Made with
  139. About the code
  140. Progress Bar
  141. Author
  142. Links
  143. Made with
  144. About a code
  145. Checkboxes Progress Bar
  146. Author
  147. Links
  148. Made with
  149. About the code
  150. Reading Progess Bar CSS Only
  151. Author
  152. Links
  153. Made with
  154. About the code
  155. Loading Bar
  156. Author
  157. Links
  158. Made with
  159. About the code
  160. Rainbow Progress Bar
  161. Author
  162. 24 Best Free CSS Progress Bars That You Can Use In 2023
  163. 1. Purple Progress Bar
  164. 2. Bars
  165. 3. CSS Circular Progress
  166. 4. Stepped Progress
  167. 5. SVG Circle Progress Bar
  168. 6. Warning Bar
  169. 7. Color Changing Loading Progress Bar
  170. 8. Only SCSS Loading Animation
  171. 9. Interactive Progress Bar Pure CSS
  172. 10. Progress
  173. 11. SVG Circle Progress Bar
  174. 12. Rainbow Progress Bar
  175. 13. Light Progress Bar
  176. 14. Dribbble Recreation: Loading Bar
  177. 15. Loading Bar
  178. 16. Pure CSS Progress
  179. 17. WebKit Progress Scrollbar [CSS Only]
  180. 18. Reading Progess Bar CSS Only
  181. 19. Expanding Loader
  182. 20. Orb Progress Bar
  183. 21. Static Progress Bar VS Progress Bar
  184. 22. Pixelated Progress Bar
  185. 23. Progress Bar Animation
  186. 24. Animated Progress Bar
Читайте также:  Название страницы

Circle progress bar with pure CSS and HTML

Progress bars are widely used on websites to highlight specific data in a more appealing way for users. One benefit of using a circle progress bar over a regular (horizontal) progress bar is that you can fit more progress bars in one row, thus displaying more data to the user.

I’ve already covered how you can style a progress bar in my earlier article. But now we’re going to look at how you can create a circle progress bar.

Setup

To display a circle progress bar with CSS we want to use as few HTML elements as possible. A proper way to show a progress bar is to use a semantic HTML element called progress.

However, it has specific default styles which make its unique appearance, thus preventing us from using all available CSS properties and displaying it as a circle.

As an alternative, we can use a div element with a progressbar role.

So to create a circle progress bar with only CSS we will need to use a div element anyway. There are two options for the markup.

Option 1

The first option is to use a regular div with a progressbar role along with additional ARIA attributes such as aria-valuenow , aria-valuemin , and aria-valuemax to indicate the range of the progress bar. HTML looks as follows:

 class="progress-bar" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100">

Option 2

The second option is to wrap a progress element inside a div and hide it with CSS. That way we use a native progress element that will still be accessible in the DOM (just visually hidden) and the div will act as a visual representation. HTML looks as follows:

 class="progress-bar">  value="75" min="0" max="100" style="visibility:hidden;height:0;width:0;">75%  

Conic gradient

Since in both HTML approaches we will be styling a div element to create a circular progress bar, we’re going to use gradients. For the background property, we’ll set a radial-gradient function and a conic-gradient function that is available in CSS.

The conic-gradient will show the actual progress (the current value) and the radial-gradient will act as a mask on top of the conic-gradient .

.progress-bar  width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(closest-side, white 79%, transparent 80% 100%), conic-gradient(hotpink 75%, pink 0); > 

To break it down. The conic-gradient function accepts multiple parameters (steps). In our case it is two steps, the first one will start at 0 degrees (12 o’clock) and span all the way up to 75% of the circumference of the circle (9 o’clock).

The radial-gradient in our case represents the mask, and consists of a white color (to match the background) and transparent color to show the progress bar.

The first parameter of the radial-gradient function is the size of the gradient’s ending shape, in our case, it is equal to the closest-side . Meaning the gradient’s ending shape meets the side of the box closest to its center.

After the size of radial-gradient , we specify the color and size of our mask (white overlay) white 79% and transparent color to take up the remaining size of the circle transparent 80% 100% . The one percent difference (79% and 80%) is made to smooth out the border of the gradient.

Browser compatibility for conic-gradient function:

Conic gradient browser support

Browser compatibility for radial-gradient function:

Radial gradient browser support

Showing the percentage

Additionally, let’s display a percentage value in the middle of the circle to inform users about the exact value of our progress bar.

To do so, we can use a pseudo-element with a content property. As for the progress bar div , we’ll need to set additional properties to center the percentage, flex in this case.

.progress-bar  display: flex; justify-content: center; align-items: center; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(closest-side, white 79%, transparent 80% 100%), conic-gradient(hotpink 75%, pink 0); > .progress-bar::before  content: "75%"; > 

Animation

💡 NOTE: The animation of such a progress bar will only work in Chromium-based browsers.

To make the progress bar animate, we’ll need to specify the value inside a CSS variable, and then change its value inside the animation.

We must use @property rule to use the variable value inside the animation, but like I said previously, this way we are limited to Chromium based browsers.

Specifying CSS variables in a traditional way like —progress-value: 0 won’t work inside the animation, as per specification they are not animatable.

Browser compatibility for @property rule:

@property browser support

We’ll need to change the percentage value to a calc() function to calculate the percentage for the conic-gradient .

Finally, let’s animate the percentage value along with the progress bar. We will do it in a similar fashion. We’ll use existing CSS variable and set it equal to a pseudo-element counter property, as well as specify the animation property.

@property --progress-value  syntax: ""; initial-value: 0; inherits: false; > @keyframes progress  to  --progress-value: 75; > > .progress-bar  display: flex; justify-content: center; align-items: center; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(closest-side, white 79%, transparent 80% 100%), conic-gradient(hotpink calc(var(--progress-value) * 1%), pink 0); animation: progress 2s 1 forwards; > .progress-bar::before  counter-reset: percentage var(--progress-value); content: counter(percentage) '%'; animation: progress 2s 1 forwards; > 

Result (refresh page):

Conclusion

While pure CSS solution for circle progress bar is easy to implement it lacks additional customization. For the most part you can only control the width and color of the bar.

Another aspect of this solution, is that it’s not yet fully supported by all browsers, the animation to be exact. So if you’re considering a bulletproof way to display a circle progress bar with animation and possible customizations, you’d might want to use SVG solution.

Finally the end result with complete code can be viewed on CodePen:

See the Pen Untitled by Nikita Hlopov (@nikitahl) on CodePen.

Источник

39 CSS Progress Bars

Collection of hand-picked free HTML and CSS progress bar code examples. Update of January 2020 collection. 10 new items.

Author

Made with

About a code

3D Circular Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Animated Skill Meter

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Custom Properties Step Progress Indicator

Author

Made with

About a code

Custom Properties Step Progress Indicator

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Glitchy Progress Display

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Progress Bar Animation #2

Author

Made with

About a code

Progress Bar Animation #2

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Circular Progress Bar

Author

Made with

About a code

Circular Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Progress Bars

Author

Made with

About a code

Progress Bars

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: CSS-Only Animated Progress Bars

Author

Made with

About a code

CSS-Only Animated Progress Bars

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

The Progress

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Progress

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Purple Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Pixel Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Color Changing Loading Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: SVG Circle Progress Bar

Author

Made with

About a code

SVG Circle Progress Bar

Compatible browsers: Chrome, Edge, Opera, Safari

Demo image: SVG Circle Progress Bar

Author

Made with

About a code

SVG Circle Progress Bar

Compatible browsers: Chrome, Edge, Opera, Safari

Author

Made with

About a code

CSS Circular Progress

Circular progress indicator made using CSS conic-gradient and custom properties.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Warning Bar

CSS animations, variables and gradients to create a scrolling warning bar.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Progress Scrollbar CSS Only

Compatible browsers: Chrome, Edge, Opera, Safari

Author

Made with

About a code

Simple Progress Bar

Simple CSS progress bar with animation.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Only CSS Loading Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Progress Bar Pure CSS

Author

Made with

About the code

Progress Bar Pure CSS

Interactive progress bar pure CSS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Animation Progress Bars

Author

Made with

About the code

Animation Progress Bars

Progress bars with CSS animation .

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: CSS Progress Bars

Author

Made with

About the code

CSS Progress Bars

CSS progress bars made with svg patterns.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Stepped Progress Bar

Author

Made with

About the code

Stepped Progress Bar

Stepped progress bar with little JS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Progress Bar

Author

Made with

About the code

Progress Bar

HTML and CSS progress bar.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Checkboxes Progress Bar

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Reading Progess Bar CSS Only

Author

Made with

About the code

Reading Progess Bar CSS Only

Experiment with a new value for the CSS position property to create a progress bar reading the articles without the need of using PHP or JavaScript, just HTML and CSS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Loading Bar

Author

Made with

About the code

Loading Bar

Pretty HTML, CSS and JS loading bar with gif image.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Rainbow Progress Bar

Author

Made with

About the code

Rainbow Progress Bar

Pure CSS and HTML progress bar, using the repeating-linear-gradient .

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Light Progress Bar

Author

Источник

24 Best Free CSS Progress Bars That You Can Use In 2023

CSS Progress Bars

24 Best Free CSS Progress Bars In 2023

CSS Progress Bars are a great way to show progress and provide feedback to users. They can be used for a variety of purposes, from indicating the amount of time left on a task to showing the completion of a process.

With the help of CSS Progress Bars code examples, you can easily create visually appealing and interactive progress bars that will make your website or application more user-friendly.

In this article, we have listed the best free HTML and CSS progress bars with demo and download link. So, you can use these code examples for designing your website.

1. Purple Progress Bar

Purple Progress Bar

Purple Progress Bar
Made By: Jasper

2. Bars

Bars

3. CSS Circular Progress

CSS Circular Progress

CSS Circular Progress
Made By: Mattia Astorino

4. Stepped Progress

Stepped Progress

Stepped Progress
Made By: Cassidy

5. SVG Circle Progress Bar

SVG Circle Progress Bar

SVG Circle Progress Bar
Made By: Ekta maurya

6. Warning Bar

Warning Bar

Warning Bar
Made By: Morgan

7. Color Changing Loading Progress Bar

Color Changing Loading Progress Bar

Color Changing Loading Progress Bar
Made By: rachelmckean

8. Only SCSS Loading Animation

Only SCSS Loading Animation: CSS Progress Bars

Only SCSS Loading Animation
Made By: Tobias Glaus

9. Interactive Progress Bar Pure CSS

Interactive Progress Bar Pure CSS

Interactive Progress Bar Pure CSS
Made By: Jenning

10. Progress

Progress

Progress
Made By: Ychnightder-both

11. SVG Circle Progress Bar

SVG Circle Progress Bar

SVG Circle Progress Bar
Made By: Ekta maurya

12. Rainbow Progress Bar

Rainbow Progress Bar

Rainbow Progress Bar
Made By: Antoinette Janus

13. Light Progress Bar

Light Progress Bar

Light Progress Bar
Made By: FEAR ØF CODE

14. Dribbble Recreation: Loading Bar

Dribbble Recreation Loading Bar

Dribbble Recreation: Loading Bar
Made By: Antoinette Janus

15. Loading Bar

Loading Bar

Loading Bar
Made By: Artboard Artisan

16. Pure CSS Progress

Pure CSS Progress

Pure CSS Progress
Made By: Rafael González

17. WebKit Progress Scrollbar [CSS Only]

WebKit Progress Scrollbar

WebKit Progress Scrollbar [CSS Only]
Made By: Myk

18. Reading Progess Bar CSS Only

Reading Progess Bar CSS Only

Reading Progess Bar CSS Only
Made By: Ricardo Prieto

19. Expanding Loader

Expanding Loader: CSS Progress Bars

Expanding Loader
Made By: Eric Gregoire

20. Orb Progress Bar

Orb Progress Bar

Orb Progress Bar
Made By: Ben Anderson

21. Static Progress Bar VS Progress Bar

Static Progress Bar VS Progress Bar

Static Progress Bar VS Progress Bar With Opposing Animation
Made By: Kevin Sweeney

22. Pixelated Progress Bar

Pixelated Progress Bar

Pixelated Progress Bar
Made By: Aleksandrs Cudars

23. Progress Bar Animation

CSS Progress Bars Animation

Progress Bar Animation
Made By: Eva Wythien

24. Animated Progress Bar

Animated CSS Progress Bars

Animated Progress Bar
Made By: Thibaut

Источник

Оцените статью