mirror of https://github.com/VERT-sh/VERT.git
feat: add delete button, improve loading bar contrast
This commit is contained in:
parent
86a893209e
commit
d55230f1ef
|
@ -10,9 +10,11 @@
|
||||||
const percent = $derived(((progress - min) / (max - min)) * 100);
|
const percent = $derived(((progress - min) / (max - min)) * 100);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full h-1 bg-foreground-muted rounded-full overflow-hidden">
|
<div
|
||||||
|
class="w-full h-1 dynadark:bg-foreground-muted-alt bg-foreground-muted rounded-full overflow-hidden"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="h-full bg-accent-background"
|
class="h-full bg-accent-background dynadark:bg-accent-foreground"
|
||||||
style="width: {percent}%; transition: 500ms linear width;"
|
style="width: {percent}%; transition: 500ms linear width;"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -45,10 +45,6 @@ export class FFmpegConverter extends Converter {
|
||||||
if (!to.startsWith(".")) to = `.${to}`;
|
if (!to.startsWith(".")) to = `.${to}`;
|
||||||
const ffmpeg = new FFmpeg();
|
const ffmpeg = new FFmpeg();
|
||||||
ffmpeg.on("progress", (progress) => {
|
ffmpeg.on("progress", (progress) => {
|
||||||
log(
|
|
||||||
["converters", this.name],
|
|
||||||
`progress for "${input.name}": ${progress.progress * 100}%`,
|
|
||||||
);
|
|
||||||
input.progress = progress.progress * 100;
|
input.progress = progress.progress * 100;
|
||||||
});
|
});
|
||||||
const baseURL =
|
const baseURL =
|
||||||
|
|
|
@ -88,7 +88,6 @@ export class VipsConverter extends Converter {
|
||||||
|
|
||||||
this.worker.addEventListener("message", onMessage);
|
this.worker.addEventListener("message", onMessage);
|
||||||
const msg = { ...message, id, worker: null };
|
const msg = { ...message, id, worker: null };
|
||||||
log(["converters", this.name], `sending message`, msg);
|
|
||||||
try {
|
try {
|
||||||
this.worker.postMessage(msg);
|
this.worker.postMessage(msg);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -138,6 +138,11 @@
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
a.remove();
|
a.remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const deleteAll = () => {
|
||||||
|
files.files = [];
|
||||||
|
goto("/");
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
@ -210,13 +215,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid md:grid-cols-2 gap-3 mt-4">
|
<div class="flex sm:flex-row flex-col gap-3 mt-4">
|
||||||
<button
|
<button
|
||||||
onclick={convertAll}
|
onclick={convertAll}
|
||||||
class={clsx("btn flex-grow", {
|
class={clsx("btn flex-grow", {
|
||||||
"btn-highlight": disabled,
|
"btn-highlight":
|
||||||
|
disabled && !processings.some((p) => p),
|
||||||
})}
|
})}
|
||||||
disabled={!allConvertersReady}
|
disabled={!allConvertersReady ||
|
||||||
|
processings.some((p) => p)}
|
||||||
>
|
>
|
||||||
{#if allConvertersReady}
|
{#if allConvertersReady}
|
||||||
Convert {files.files.length > 1 ? "All" : ""}
|
Convert {files.files.length > 1 ? "All" : ""}
|
||||||
|
@ -232,6 +239,13 @@
|
||||||
{disabled}
|
{disabled}
|
||||||
>Download {files.files.length > 1 ? "All" : ""}</button
|
>Download {files.files.length > 1 ? "All" : ""}</button
|
||||||
>
|
>
|
||||||
|
<button
|
||||||
|
onclick={deleteAll}
|
||||||
|
disabled={processings.some((p) => p)}
|
||||||
|
class="btn flex-grow"
|
||||||
|
>
|
||||||
|
Delete All
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -276,7 +290,7 @@
|
||||||
<div class="w-full lg:flex-grow">
|
<div class="w-full lg:flex-grow">
|
||||||
<div
|
<div
|
||||||
class={clsx(
|
class={clsx(
|
||||||
"py-2 px-3 lg:w-full lg:flex rounded-xl transition-colors duration-300 sm:w-fit w-full flex-shrink sm:text-left text-center",
|
"py-2 px-3 lg:justify-between lg:w-full lg:flex rounded-xl transition-colors duration-300 sm:w-fit w-full flex-shrink sm:text-left text-center",
|
||||||
{
|
{
|
||||||
"bg-accent-background text-accent-foreground":
|
"bg-accent-background text-accent-foreground":
|
||||||
file.result,
|
file.result,
|
||||||
|
@ -286,7 +300,7 @@
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<h3
|
<h3
|
||||||
class="lg:flex-grow flex-shrink whitespace-nowrap overflow-hidden text-ellipsis sm:max-w-96"
|
class="lg:flex-grow lg:w-full flex-shrink whitespace-nowrap overflow-hidden text-ellipsis sm:max-w-96"
|
||||||
>
|
>
|
||||||
{file.file.name}
|
{file.file.name}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
Loading…
Reference in New Issue