diff --git a/web/src/lib/components/DownloadButton.svelte b/web/src/lib/components/DownloadButton.svelte index 1658f01..c452846 100644 --- a/web/src/lib/components/DownloadButton.svelte +++ b/web/src/lib/components/DownloadButton.svelte @@ -1,21 +1,18 @@ - + diff --git a/web/src/lib/components/DropZone.svelte b/web/src/lib/components/DropZone.svelte index c9a697e..4bccdb3 100644 --- a/web/src/lib/components/DropZone.svelte +++ b/web/src/lib/components/DropZone.svelte @@ -33,7 +33,7 @@
import type { ImageInfo } from '$lib/core/analyze'; - let { info }: { info: ImageInfo | null } = $props(); + interface Props { + info: ImageInfo | null; + } + + let { info }: Props = $props(); {#if info}
-
+
Размеры
{info.width} × {info.height} px
-
+
Альфа-канал
{info.hasAlpha ? 'есть — есть полупрозрачные пиксели' : 'нет'}
-
+
Уникальных цветов (RGBA)
{info.colorCount.toLocaleString('ru-RU')}
@@ -33,9 +37,6 @@ justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); - background: var(--surface); - border: 1px solid var(--border); - border-radius: var(--radius-s); } dt { diff --git a/web/src/lib/components/ParamForm.svelte b/web/src/lib/components/ParamForm.svelte index b821aa6..65b2491 100644 --- a/web/src/lib/components/ParamForm.svelte +++ b/web/src/lib/components/ParamForm.svelte @@ -1,89 +1,39 @@ {#each params as param (param.id)} -
- {#if param.type === 'checkbox'} - - {:else} - - {#if param.type === 'number'} - - {:else if param.type === 'select'} - - {:else if param.type === 'color'} - - {/if} - {/if} -
+ {#if param.type === 'checkbox'} + + {:else if param.type === 'number'} + + {:else if param.type === 'select'} + + {:else if param.type === 'color'} + + {/if} {/each} - - diff --git a/web/src/lib/components/ToolPage.svelte b/web/src/lib/components/ToolPage.svelte index ad9e250..f7a6f5b 100644 --- a/web/src/lib/components/ToolPage.svelte +++ b/web/src/lib/components/ToolPage.svelte @@ -3,8 +3,10 @@ import { decodeFile } from '$lib/core/io'; import type { PixelImage } from '$lib/core/types'; import { defaultParams, outputOf, sanitizeParams, type ToolEntry } from '$lib/registry'; + import Button from './ui/Button.svelte'; import DownloadButton from './DownloadButton.svelte'; import DropZone from './DropZone.svelte'; + import EmptyState from './ui/EmptyState.svelte'; import InfoPanel from './InfoPanel.svelte'; import ParamForm from './ParamForm.svelte'; import Preview from './Preview.svelte'; @@ -75,10 +77,10 @@

{tool.title}

-

{tool.description}

+

{tool.description}

{#if errorText} - + {/if} {#if !source} @@ -86,28 +88,37 @@ {:else}
-

{isInfo ? 'Изображение' : 'Результат'}

+

{isInfo ? 'Изображение' : 'Результат'}

{#if status === 'processing' && !result} -

Обработка…

+ {:else} {/if} {#if isInfo && info} {/if} - +
+ +
{#if !isInfo}
-

Параметры

+

Параметры

{#if tool.params.length > 0} - + {:else} -

У этого инструмента нет параметров — результат уже готов.

+

+ У этого инструмента нет параметров — результат уже готов. +

{/if}
diff --git a/web/src/lib/components/ui/Button.svelte b/web/src/lib/components/ui/Button.svelte index 72e7b68..9e55a9a 100644 --- a/web/src/lib/components/ui/Button.svelte +++ b/web/src/lib/components/ui/Button.svelte @@ -7,6 +7,7 @@ disabled?: boolean; busy?: boolean; busyText?: string; + fullWidth?: boolean; onclick?: () => void; children: Snippet; } @@ -17,6 +18,7 @@ disabled = false, busy = false, busyText = '', + fullWidth = false, onclick, children }: Props = $props(); @@ -24,7 +26,7 @@
@@ -66,7 +68,7 @@ .nav-link { color: var(--text-muted); - font-size: 0.9rem; + font-size: var(--text-s); padding: var(--space-1) var(--space-2); border-radius: var(--radius-s); } @@ -88,8 +90,6 @@ footer { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); - color: var(--text-muted); - font-size: 0.85rem; text-align: center; } diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 47132c9..186ac8f 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -12,7 +12,7 @@

easy-png-tools

-

+

Набор утилит для работы с PNG. Все операции выполняются локально в браузере — файлы никуда не отправляются.

@@ -21,12 +21,12 @@ {@const categoryTools = TOOLS.filter((tool) => tool.category === category.id)} {#if categoryTools.length > 0}
-

{category.label}

+

{category.label}

{#each categoryTools as tool (tool.id)} - + {tool.title} - {tool.description} + {tool.description} {/each}
@@ -40,7 +40,6 @@ } .lead { - color: var(--text-muted); max-width: 48rem; margin-bottom: var(--space-5); } @@ -51,10 +50,6 @@ } h2 { - font-size: 1.1rem; - color: var(--text-muted); - text-transform: uppercase; - letter-spacing: 0.04em; margin-bottom: var(--space-3); } @@ -69,27 +64,23 @@ flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-4); - background: var(--surface); - border: 1px solid var(--border); - border-radius: var(--radius-m); - text-decoration: none; color: inherit; transition: - border-color 120ms ease, - box-shadow 120ms ease, - transform 120ms ease; + border-color var(--transition-fast), + box-shadow var(--transition-fast), + transform var(--transition-fast); } .card:hover { text-decoration: none; border-color: var(--accent); - box-shadow: 0 4px 14px rgb(37 99 235 / 12%); + box-shadow: var(--shadow-card); transform: translateY(-1px); } .card-title { font-weight: 600; - font-size: 0.95rem; + font-size: var(--text-m); } .card:hover .card-title { @@ -97,8 +88,6 @@ } .card-desc { - font-size: 0.85rem; - color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;