Skip to content

Commit dda5490

Browse files
committed
1 parent 129b3bc commit dda5490

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

adminforth/spa/src/afcl/ProgressBar.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<span class="absolute -top-6 right-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ rightLabel }}</span>
55
<div
66
class="bg-lightProgressBarFilledColor dark:bg-darkProgressBarFilledColor h-2.5 rounded-full transition-all duration-300 ease-in-out"
7+
:class="{ 'progress-bar': showAnimation }"
78
:style="{ width: `${percentage}%` }"
89
></div>
910
<span v-if="showValues" class="absolute top-4 left-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ formatValue(minValue) }}</span>
@@ -26,6 +27,7 @@ interface Props {
2627
showLabels?: boolean
2728
showValues?: boolean
2829
showProgress?: boolean
30+
showAnimation?: boolean
2931
}
3032
3133
const props = withDefaults(defineProps<Props>(), {
@@ -53,3 +55,34 @@ const formatValue = (value: number): string => {
5355
return formatter(value)
5456
}
5557
</script>
58+
59+
60+
<style scoped>
61+
.progress-bar {
62+
position: relative;
63+
overflow: hidden;
64+
}
65+
66+
.progress-bar::after {
67+
content: "";
68+
position: absolute;
69+
inset: 0;
70+
width: 100%;
71+
72+
background: linear-gradient(
73+
-45deg,
74+
transparent 35%,
75+
rgba(255,255,255,0.4),
76+
transparent 65%
77+
);
78+
79+
transform: translateX(-100%);
80+
animation: progress-slide 2s linear infinite;
81+
}
82+
83+
@keyframes progress-slide {
84+
100% {
85+
transform: translateX(100%);
86+
}
87+
}
88+
</style>

0 commit comments

Comments
 (0)