Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the special effect of interactive circular progress bar with HTML5

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to achieve interactive circular progress bar special effects in HTML5". In daily operation, I believe many people have doubts about how to achieve interactive circular progress bar special effects in HTML5. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how HTML5 can achieve interactive circular progress bar special effects". Next, please follow the editor to study!

Plug-in description: this is a very cool HTML5 interactive circular progress bar special effects. The circular progress bar consists of 32 rounded rectangles, and users can click on each rounded rectangle to set the progress bar to the corresponding scale. It uses js to create interactive animation effects, and with the mouse slide out of date effect, very cool.

Manufacturing method

HTML structure

Each of the 32 rounded rectangles that make up the circular progress bar is actually a combination of input.radio and. The percentage value used by div.barPie__value to display the current progress. The data-to-value in the package container is used for the initial value of the circular progress bar.

0

.

CSS style

The entire circular progress bar sets a fixed width and height, and sets the center display. .barPie-- radio? {

Margin:?20px

Width:?400px

Height:?400px

Text-align:?center

Font:?700?50px?'Open?Sans?Condensed',?sans-serif

Position:?absolute

Top:?0

Left:?0

Bottom:?0

Right:?0

Margin:?auto

}

And use the perspective property to create perspective. .barPie? {

-webkit-perspective:?1000px

Perspective:?1000px

}

All rounded rectangles are made of elements and are rotated at different angles to form a circle. .barPie _ _ ring__item? {

Position:?absolute

Width:?34px

Height:?50%

Top:?0

Left:?50%

Margin-left:?-17px

-webkit-transform-origin:?50%?100%

-ms-transform-origin:?50%?100%

Transform-origin:?50%?100%

-webkit-transition:?.1s

Transition:?.1s

}

.barPie _ _ ring__item:nth-of-type (1)? {

-webkit-transform:?rotate (11.25deg)

-ms-transform:?rotate (11.25deg)

Transform:?rotate (11.25deg)

}

.barPie _ _ ring__item:nth-of-type (1):: before? {

-webkit-transition-delay:?12ms

Transition-delay:?12ms

}

...

Element's: before pseudo-elements are used to make grooves for rounded rectangles, and their color is set to white with 0.15 transparency. And set their transparency to 0.7 when the mouse is out of date, and 0.4 to its sibling nodes. .barPie _ _ ring__item::before? {

Content:?''

Display:?block

Width:?50%

Height:?30%

Border-radius:?10px

Background:?rgba (00.15)

Box-shadow:?0?0?0?1px?rgba (255), 0?0?4px?rgba (0), inset

-webkit-transition:?.3s

Transition:?.3s

}

.barPie _ _ ring__item:hover::before? {

Opacity:?.7

}

.barPie _ _ ring__item:hover::before

.barPie _ _ ring__item:hover?--?.barPie__ring__item::before? {

Background:?rgba (255meme, 255meme0.4)

-webkitMusictionRod 0swatches

Transition:?0s?!important

}

The rounded rectangle in the checked state is set to white with 80% transparency. .barPie _ _ ring?:checked?--?.barPie__ring__item::before? {

Background:?rgba (255pm, 255pm, 255pm)

Box-shadow:?0?0?4px?rgba (255meme / 255pence0.5)

-webkit-transition:?0s

Transition:?0s

}

At this point, the study on "how to achieve interactive circular progress bar effects in HTML5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report