gpt4 book ai didi

html - 这些圆形进度条是如何填充的?

转载 作者:行者123 更新时间:2023-11-27 22:53:58 24 4
gpt4 key购买 nike

<分区>

我发现了一些圆形进度条,但我无法弄清楚它们是如何填充的。这是一些代码笔的链接:https://codepen.io/anon/pen/aeEEmx

据我所知,当您使用渐变并添加位置(在本例中为 deg)时,它应该从您指定值的位置开始。例如,在 css 中具有 progress-20 类的那个有一个 18 度的线性渐变,然后是另一个 90 度的线性渐变,但我不明白这些值如何在 30% 的 18 度和 90 度或 -18 度和 90 度中一起工作.

代码如下:

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html,
body {
background-color: #fff;
font-family: "Lato", "Arial", "san-serif";
color: #555;
font-size: 20px;
font-weight: 300px;
text-rendering: optimizeLegibility;
}

.radialProgressBar {
border-radius: 50%;
-webkit-transform: translate(50%, 50%);
transform: translate(50%, 50%);
width: 100px;
height: 100px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background: #ddd;
margin: 20px;
}

.radialProgressBar .overlay {
border-radius: 50%;
width: 80px;
height: 80px;
margin: auto;
background: #fff;
text-align: center;
padding-top: 30%;
}

.progress-20 {
background-image: linear-gradient(18deg, #ddd 50%, transparent 50%), linear-gradient(90deg, #028cd5 50%, #ddd 50%);
}

.progress-30 {
background-image: linear-gradient(-18deg, #ddd 50%, transparent 50%), linear-gradient(90deg, #028cd5 50%, #ddd 50%);
}

.progress-40 {
background-image: linear-gradient(-54deg, #ddd 50%, transparent 50%), linear-gradient(90deg, #028cd5 50%, #ddd 50%);
}

.progress-70 {
background-image: linear-gradient(90deg, #028cd5 50%, transparent 50%), linear-gradient(18deg, #028cd5 50%, #ddd 50%);
}
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

<body>
<div class="radialProgressBar progress-20">
<div class="overlay">20</div>
</div>
<div class="radialProgressBar progress-30">
<div class="overlay">30</div>
</div>
<div class="radialProgressBar progress-40">
<div class="overlay">40</div>
</div>
<div class="radialProgressBar progress-70">
<div class="overlay">70</div>
</div>
</body>

</html>

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com