146 lines
2.5 KiB
CSS
146 lines
2.5 KiB
CSS
@property --p {
|
|
syntax: "<number>";
|
|
inherits: true;
|
|
initial-value: 0;
|
|
}
|
|
|
|
.pie {
|
|
--p:20;
|
|
--b:8px;
|
|
--c:lightgreen;
|
|
--w:90px;
|
|
|
|
width: var(--w);
|
|
aspect-ratio:1;
|
|
display:inline-grid;
|
|
position: relative;
|
|
place-content:center;
|
|
font-size:25px;
|
|
margin: 5px 20px 5px 5px;
|
|
}
|
|
|
|
.pie:before,
|
|
.pie:after {
|
|
content:"";
|
|
position:absolute;
|
|
border-radius:50%;
|
|
}
|
|
.pie:before {
|
|
inset:0;
|
|
background:
|
|
radial-gradient(farthest-side,var(--c) 98%,#0000) top/var(--b) var(--b) no-repeat,
|
|
conic-gradient(var(--c) calc(var(--p)*1%),#0000 0);
|
|
-webkit-mask:radial-gradient(farthest-side,#0000 calc(99% - var(--b)),#000 calc(100% - var(--b)));
|
|
mask:radial-gradient(farthest-side,#0000 calc(99% - var(--b)),#000 calc(100% - var(--b)));
|
|
}
|
|
.pie:after {
|
|
inset:calc(50% - var(--b)/2);
|
|
background:var(--c);
|
|
transform:rotate(calc(var(--p)*3.6deg)) translateY(calc(50% - var(--w)/2));
|
|
}
|
|
@keyframes p {
|
|
from{--p:0}
|
|
}
|
|
.animate {
|
|
animation:p 1s .5s both;
|
|
}
|
|
.no-round:before {
|
|
background-size: 0 0, auto;
|
|
}
|
|
.no-round:after {
|
|
content: none;
|
|
}
|
|
|
|
@property --value {
|
|
syntax: "<number>";
|
|
inherits: true;
|
|
initial-value: 0;
|
|
}
|
|
|
|
.line {
|
|
--value: 8;
|
|
--max: 10;
|
|
|
|
position: relative;
|
|
margin: 1em;
|
|
width: 100%;
|
|
height: 2px;
|
|
background-color: #343a405A;
|
|
animation:l 1s .5s both;
|
|
}
|
|
|
|
.line:after {
|
|
content: "";
|
|
display: block;
|
|
height: 4px;
|
|
top: -1px;
|
|
position: absolute;
|
|
background-color: lightgreen;
|
|
width: calc(var(--value) / var(--max) * 100%);
|
|
z-index: 2;
|
|
}
|
|
|
|
.line:before {
|
|
content: "";
|
|
display: block;
|
|
height: 8px;
|
|
width: 8px;
|
|
top: -3px;
|
|
position: absolute;
|
|
background-color: lightgreen;
|
|
left: calc(var(--value) / var(--max) * 100%);
|
|
z-index: 2;
|
|
}
|
|
|
|
.line * {
|
|
position: absolute;
|
|
top: 5px;
|
|
color: #343a40;
|
|
}
|
|
|
|
.line .line_max {
|
|
right: 0;
|
|
}
|
|
|
|
.line .line_value {
|
|
left: calc(var(--value) / var(--max) * 100%);
|
|
}
|
|
|
|
h6.line_label {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
@keyframes l {
|
|
from {--value: 0}
|
|
}
|
|
|
|
h6.info {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
span.info {
|
|
padding: 0 10px;
|
|
width: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
span.info-start {
|
|
padding: 0 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
span.info-start * {
|
|
margin: 0 5px;
|
|
}
|
|
|
|
.cont {
|
|
padding: 1rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
} |