feat: add clear all button

fixes #40
This commit is contained in:
JovannMC 2025-03-09 17:03:40 +03:00
parent 784907c39b
commit 1c98747fd9
No known key found for this signature in database
3 changed files with 19 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { effects, files } from "$lib/store/index.svelte"; import { effects, files } from "$lib/store/index.svelte";
import { FolderArchiveIcon, RefreshCw } from "lucide-svelte"; import { FolderArchiveIcon, RefreshCw, Trash2Icon } from "lucide-svelte";
import Panel from "../visual/Panel.svelte"; import Panel from "../visual/Panel.svelte";
import Dropdown from "./Dropdown.svelte"; import Dropdown from "./Dropdown.svelte";
</script> </script>
@ -27,6 +27,13 @@
<FolderArchiveIcon size="24" /> <FolderArchiveIcon size="24" />
<p>Download all as .zip</p> <p>Download all as .zip</p>
</button> </button>
<button
class="btn p-4 {$effects ? '' : '!scale-100'} flex gap-3 max-md:w-full"
disabled={files.files.length === 0}
onclick={() => files.files = []}
>
<Trash2Icon size="24" />
</button>
</div> </div>
<div class="w-full bg-separator h-0.5 flex md:hidden"></div> <div class="w-full bg-separator h-0.5 flex md:hidden"></div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">

View File

@ -2,7 +2,12 @@
import { browser } from "$app/environment"; import { browser } from "$app/environment";
import { page } from "$app/state"; import { page } from "$app/state";
import { duration, fade } from "$lib/animation"; import { duration, fade } from "$lib/animation";
import { effects, files, goingLeft, setTheme } from "$lib/store/index.svelte"; import {
effects,
files,
goingLeft,
setTheme,
} from "$lib/store/index.svelte";
import clsx from "clsx"; import clsx from "clsx";
import { import {
InfoIcon, InfoIcon,
@ -74,9 +79,9 @@
i.activeMatch(e.to?.url.pathname || ""), i.activeMatch(e.to?.url.pathname || ""),
); );
if (newIndex < oldIndex) { if (newIndex < oldIndex) {
goingLeft.set(true) goingLeft.set(true);
} else { } else {
goingLeft.set(false) goingLeft.set(false);
} }
}); });
</script> </script>
@ -88,7 +93,7 @@
href={item.url} href={item.url}
aria-label={item.name} aria-label={item.name}
class={clsx( class={clsx(
"w-16 md:w-32 h-full relative z-10 rounded-xl flex items-center justify-center gap-3 overflow-hidden", "min-w-16 md:min-w-32 h-full relative z-10 rounded-xl flex flex-1 items-center justify-center gap-3 overflow-hidden",
{ {
"bg-panel-highlight": "bg-panel-highlight":
item.activeMatch(page.url.pathname) && !browser, item.activeMatch(page.url.pathname) && !browser,
@ -148,7 +153,7 @@
{/snippet} {/snippet}
<div bind:this={container}> <div bind:this={container}>
<Panel class="max-w-[778px] w-full h-20 flex items-center gap-3 relative"> <Panel class="max-w-[778px] w-screen h-20 flex items-center gap-3 relative">
{#if linkRects[selectedIndex]} {#if linkRects[selectedIndex]}
<div <div
class="absolute bg-panel-highlight rounded-xl" class="absolute bg-panel-highlight rounded-xl"

View File

@ -36,7 +36,7 @@ export class VipsConverter extends Converter {
".heif", // HEIF files that are encoded like HEIC files (and HEIC files in general) aren't supported due to https://github.com/kleisauke/wasm-vips/issues/3 ".heif", // HEIF files that are encoded like HEIC files (and HEIC files in general) aren't supported due to https://github.com/kleisauke/wasm-vips/issues/3
".avif", ".avif",
".jxl", ".jxl",
".svg", ".svg"
]; ];
public readonly reportsProgress = false; public readonly reportsProgress = false;