AnthoLume/templates/components/download-progress.tmpl

43 lines
1.3 KiB
Cheetah
Raw Normal View History

2024-06-16 21:11:03 +00:00
<div
class="absolute -translate-y-1/2 p-4 m-auto bg-gray-700 dark:bg-gray-300 rounded-lg shadow w-full text-black dark:text-white"
>
<span
class="inline-flex gap-2 items-center font-medium text-xs inline-block py-1 px-2 uppercase rounded-full {{ if .Error }}
bg-red-500
{{ else if true }}
bg-green-600
{{ end }}"
>
2024-01-25 02:40:14 +00:00
{{ if and (ne .Progress 100) (not .Error) }}
2024-06-16 21:11:03 +00:00
{{ template "svg/loading" (dict "Size" 16) }}
2024-01-25 02:40:14 +00:00
{{ end }}
{{ .Message }}
</span>
<div class="flex flex-col gap-2 mt-2">
<div class="relative w-full h-4 bg-gray-300 dark:bg-gray-700 rounded-full">
{{ if .Error }}
2024-06-16 21:11:03 +00:00
<div
class="absolute h-full bg-red-500 rounded-full"
style="width: 100%"
></div>
<p class="absolute w-full h-full font-bold text-center text-xs">
ERROR
</p>
2024-01-25 02:40:14 +00:00
{{ else }}
2024-06-16 21:11:03 +00:00
<div
class="absolute h-full bg-green-600 rounded-full"
style="width: {{ .Progress }}%"
></div>
<p class="absolute w-full h-full font-bold text-center text-xs">
{{ .Progress }}%
</p>
2024-01-25 02:40:14 +00:00
{{ end }}
</div>
2024-06-16 21:11:03 +00:00
<a
href="{{ .ButtonHref }}"
class="w-full text-center font-medium px-2 py-1 text-white bg-gray-500 dark:text-gray-800 hover:bg-gray-800 dark:hover:bg-gray-100"
>{{ .ButtonText }}</a
>
2024-01-25 02:40:14 +00:00
</div>
</div>