The next-generation file converter. Open source, fully local* and free forever.
refactor: use clsx
JovannMCfea74fac9284
diff --git a/src/lib/components/functional/ConversionPanel.svelte b/src/lib/components/functional/ConversionPanel.svelteindex fbb6c0c..8b283b1 100644--- a/src/lib/components/functional/ConversionPanel.svelte+++ b/src/lib/components/functional/ConversionPanel.svelte@@ -8,6 +8,7 @@import FormatDropdown from "./FormatDropdown.svelte";import { categories } from "$lib/converters";import { m } from "$lib/paraglide/messages";+ import { clsx } from "clsx";const length = $derived(files.files.length);const progress = $derived(files.files.filter((f) => f.result).length);@@ -43,11 +44,11 @@><buttononclick={() => files.convertAll()}- class="btn {$effects- ? ''- : '!scale-100'} highlight flex gap-3 max-md:w-full {compactActions- ? 'p-4'- : 'md:max-w-[15.5rem]'}"+ class={clsx(+ "btn highlight flex gap-3 max-md:w-full",+ !$effects && "!scale-100",+ compactActions ? "p-4" : "md:max-w-[15.5rem]",+ )}disabled={!files.allReady}><RefreshCw size="24" />@@ -56,11 +57,11 @@{/if}</button><button- class="btn {$effects- ? ''- : '!scale-100'} flex gap-3 max-md:w-full {compactActions- ? 'p-4'- : 'md:max-w-[15.5rem]'}"+ class={clsx(+ "btn flex gap-3 max-md:w-full",+ !$effects && "!scale-100",+ compactActions ? "p-4" : "md:max-w-[15.5rem]",+ )}disabled={!files.allReady || !files.results}onclick={() => files.downloadAll()}>diff --git a/src/lib/components/functional/Dropdown.svelte b/src/lib/components/functional/Dropdown.svelteindex f377832..0e87bb7 100644--- a/src/lib/components/functional/Dropdown.svelte+++ b/src/lib/components/functional/Dropdown.svelte@@ -195,8 +195,10 @@{#each options as option}<buttondata-selected={getValue(option) === selected}- class={`w-full p-2 px-4 text-left hover:bg-panel font-normal text-sm text-muted- ${getValue(option) === selected ? "bg-separator" : ""}`}+ class={clsx(+ "w-full p-2 px-4 text-left hover:bg-panel font-normal text-sm text-muted",+ getValue(option) === selected && "bg-separator",+ )}onclick={() => select(option)}>{getLabel(option)}diff --git a/src/lib/components/functional/Uploader.svelte b/src/lib/components/functional/Uploader.svelteindex a9a95c5..069d433 100644--- a/src/lib/components/functional/Uploader.svelte+++ b/src/lib/components/functional/Uploader.svelte@@ -60,7 +60,9 @@onclick={uploadFiles}bind:this={uploaderButton}class={clsx(- `hover:scale-105 active:scale-100 ${$effects ? "" : "!scale-100"} duration-200 ${classList}`,+ "hover:scale-105 active:scale-100 duration-200",+ !$effects && "!scale-100",+ classList,)}><Paneldiff --git a/src/lib/sections/about/Credits.svelte b/src/lib/sections/about/Credits.svelteindex a945735..73dfa0b 100644--- a/src/lib/sections/about/Credits.svelte+++ b/src/lib/sections/about/Credits.svelte@@ -7,6 +7,7 @@} from "$lib/util/consts";import { m } from "$lib/paraglide/messages";import { link, sanitize } from "$lib/store/index.svelte";+ import { clsx } from "clsx";let { mainContribs, notableContribs, ghContribs } = $props();</script>@@ -29,11 +30,14 @@src={avatar}alt={name}title={name}- class="{smaller- ? 'w-12 h-12 hoverable'- : role- ? 'w-14 h-14 hoverable-md'- : 'w-10 h-10 hoverable-lg'} rounded-full"+ class={clsx(+ smaller+ ? "w-12 h-12 hoverable"+ : role+ ? "w-14 h-14 hoverable-md"+ : "w-10 h-10 hoverable-lg",+ "rounded-full",+ )}/></a>{#if role}