/
CommonProgressBar.vue
78 lines (65 loc) · 1.5 KB
/
CommonProgressBar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
<script setup lang="ts">
export interface Props {
value?: string
max?: string
}
defineProps<Props>()
</script>
<template>
<progress
class="progress"
tabindex="0"
:aria-label="$t('Indicating progress')"
:value="value"
:max="max"
/>
</template>
<style scoped>
.progress {
@apply rounded-box h-2 bg-blue-200 dark:bg-gray-700;
&::-moz-progress-bar {
@apply rounded-none bg-blue-800;
}
&::-webkit-progress-bar {
@apply rounded-box;
}
&::-webkit-progress-value {
@apply rounded-none bg-blue-800;
transition: width 1s;
}
&:indeterminate {
--progress-color: theme(colors.blue.800);
}
&:indeterminate {
background-image: repeating-linear-gradient(
90deg,
var(--progress-color) -1%,
var(--progress-color) 10%,
transparent 10%,
transparent 90%
);
background-size: 200%;
background-position-x: 15%;
animation: progress-loading 5s ease-in-out infinite;
}
&:indeterminate::-moz-progress-bar {
@apply bg-blue-200 dark:bg-gray-700;
background-image: repeating-linear-gradient(
90deg,
var(--progress-color) -1%,
var(--progress-color) 10%,
transparent 10%,
transparent 90%
);
background-size: 200%;
background-position-x: 15%;
animation: progress-loading 5s ease-in-out infinite;
}
@keyframes progress-loading {
50% {
background-position-x: -115%;
}
}
}
</style>