CommonProgressBar.vue 1.5 KB

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