tu-view-plus
Version:
196 lines (183 loc) • 5.2 kB
CSS
.tu-progress {
position: relative;
line-height: 1;
display: flex;
align-items: center;
}
.tu-progress__text {
font-size: 14px;
color: var(--tu-color-text, #71757f);
margin-left: 5px;
min-width: 50px;
line-height: 1;
}
.tu-progress__text i {
vertical-align: middle;
display: block;
}
.tu-progress--circle, .tu-progress--dashboard {
display: inline-block;
}
.tu-progress--circle .tu-progress__text, .tu-progress--dashboard .tu-progress__text {
position: absolute;
top: 50%;
left: 0;
width: 100%;
text-align: center;
margin: 0;
transform: translate(0, -50%);
}
.tu-progress--circle .tu-progress__text i, .tu-progress--dashboard .tu-progress__text i {
vertical-align: middle;
display: inline-block;
}
.tu-progress--circle .tu-progress-circle__outer, .tu-progress--dashboard .tu-progress-circle__outer {
position: absolute;
top: 0;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
}
.tu-progress--circle .tu-progress-circle__outer::before, .tu-progress--dashboard .tu-progress-circle__outer::before {
content: "";
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
width: 100%;
height: 100%;
box-shadow: inset 4px 4px 4px var(--tu-color-shadow-dark, #babbc0), inset -2px -2px 3px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress--circle .tu-progress-circle__outer::after, .tu-progress--dashboard .tu-progress-circle__outer::after {
content: "";
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
width: calc(100% - var(--stroke-width));
height: calc(100% - var(--stroke-width));
box-shadow: 3px 3px 4px var(--tu-color-shadow-dark, #babbc0), -1px -1px 4px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress--circle .tu-progress-circle__outer.is-narrow::before, .tu-progress--dashboard .tu-progress-circle__outer.is-narrow::before {
box-shadow: inset 2px -1px 4px var(--tu-color-shadow-dark, #babbc0), inset -2px -2px 3px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress--circle .tu-progress-circle__outer.is-narrow::after, .tu-progress--dashboard .tu-progress-circle__outer.is-narrow::after {
box-shadow: 3px 3px 4px var(--tu-color-shadow-dark, #babbc0), -1px -1px 4px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress--circle .tu-progress-circle__inner, .tu-progress--dashboard .tu-progress-circle__inner {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.tu-progress--without-text .tu-progress__text {
display: none;
}
.tu-progress--without-text .tu-progress__bar {
padding-right: 0;
margin-right: 0;
display: block;
}
.tu-progress--text-inside .tu-progress__bar {
padding-right: 0;
margin-right: 0;
}
.tu-progress.is-success .tu-progress-bar__inner {
background-color: var(--tu-color-success, #50d4ab);
}
.tu-progress.is-success .tu-progress__text {
color: var(--tu-color-success, #50d4ab);
}
.tu-progress.is-warning .tu-progress-bar__inner {
background-color: var(--tu-color-warning, #fa9841);
}
.tu-progress.is-warning .tu-progress__text {
color: var(--tu-color-warning, #fa9841);
}
.tu-progress.is-exception .tu-progress-bar__inner {
background-color: var(--tu-color-danger, #f66f6a);
}
.tu-progress.is-exception .tu-progress__text {
color: var(--tu-color-danger, #f66f6a);
}
.tu-progress-bar {
flex-grow: 1;
box-sizing: border-box;
}
.tu-progress-bar__outer {
height: 6px;
border-radius: 100px;
overflow: hidden;
position: relative;
vertical-align: middle;
box-shadow: inset 2px 2px 5px var(--tu-color-shadow-dark, #babbc0), inset -2px -2px 5px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress-bar__outer.is-narrow {
box-shadow: inset 1px 1px 2px var(--tu-color-shadow-dark, #babbc0), inset -1px -1px 2px var(--tu-color-shadow-light, #ffffff);
}
.tu-progress-bar__inner {
position: absolute;
left: 0;
top: 0;
height: 100%;
background-color: var(--tu-color-primary, #5e7ce0);
text-align: right;
border-radius: 100px;
line-height: 1;
white-space: nowrap;
transition: width 0.6s ease;
z-index: 2;
}
.tu-progress-bar__inner::after {
display: inline-block;
content: "";
height: 100%;
vertical-align: middle;
}
.tu-progress-bar__inner--indeterminate {
transform: translateZ(0);
animation: indeterminate 3s infinite;
}
.tu-progress-bar__inner--striped {
background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.1) 75%, transparent 75%, transparent);
background-size: 1.25em 1.25em;
}
.tu-progress-bar__inner--striped.tu-progress-bar__inner--striped-flow {
animation: striped-flow 3s linear infinite;
}
.tu-progress-bar__innerText {
display: inline-block;
vertical-align: middle;
color: var(--tu-color-white, #ffffff);
font-size: 12px;
margin: 0 5px;
}
@keyframes progress {
0% {
background-position: 0 0;
}
100% {
background-position: 32px 0;
}
}
@keyframes indeterminate {
0% {
left: -100%;
}
100% {
left: 100%;
}
}
@keyframes striped-flow {
0% {
background-position: -100%;
}
100% {
background-position: 100%;
}
}