fix: dl disabling

This commit is contained in:
not-nullptr 2024-11-12 11:35:29 +00:00
parent 9e07443148
commit 7fad1fd0bd
2 changed files with 10 additions and 2 deletions

View File

@ -31,6 +31,9 @@ body {
}
.btn {
@apply font-display flex items-center justify-center overflow-hidden relative cursor-pointer px-4 border-2 border-solid bg-background border-foreground-muted-alt rounded-xl p-2 focus:!outline-none hover:scale-105 transition-transform duration-200 active:scale-95;
@apply font-display flex items-center justify-center overflow-hidden relative cursor-pointer px-4 border-2 border-solid bg-background border-foreground-muted-alt rounded-xl p-2 focus:!outline-none hover:scale-105 active:scale-95 disabled:pointer-events-none disabled:opacity-50;
transition:
200ms ease transform,
200ms ease opacity;
}
}

View File

@ -20,6 +20,8 @@
let converter = $derived(converters.find((c) => c.name === converterName))!;
let disabled = $derived(files.files.some((f) => !f.result));
onMount(() => {
finisheds.forEach((_, i) => {
const duration = 750 + i * 50 - 32;
@ -197,7 +199,10 @@
? " All"
: ""}</button
>
<button onclick={downloadAll} class="btn flex-grow"
<button
onclick={downloadAll}
class="btn flex-grow"
{disabled}
>Download{files.files.length > 1
? " All"
: ""}</button