diff --git a/web/src/app.css b/web/src/app.css index 586e290..94fbb1c 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -198,6 +198,27 @@ input.control[type='number'] { margin-top: var(--space-4); } +.edge-legend { + position: absolute; + top: -0.65em; + padding: 0 var(--space-2); + background: var(--surface); + color: var(--text-muted); + font-size: var(--text-xs); + text-transform: uppercase; + letter-spacing: 0.04em; + line-height: 1.3; + white-space: nowrap; + z-index: 1; +} + +.params-sep { + position: relative; + border-top: 1px solid var(--border); + margin: 0 var(--space-4); + padding-bottom: var(--space-3); +} + .actions-row { display: flex; gap: var(--space-1); diff --git a/web/src/lib/components/ParamForm.svelte b/web/src/lib/components/ParamForm.svelte index ae820d8..cdefd96 100644 --- a/web/src/lib/components/ParamForm.svelte +++ b/web/src/lib/components/ParamForm.svelte @@ -11,50 +11,84 @@ values: Record; pipetteTargetId?: string | null; onPipetteToggle?: (id: string) => void; + hasMask?: boolean; + showMask?: boolean; } - let { params, values = $bindable(), pipetteTargetId = null, onPipetteToggle }: Props = $props(); + let { + params, + values = $bindable(), + pipetteTargetId = null, + onPipetteToggle, + hasMask = false, + showMask = $bindable(false) + }: Props = $props(); -{#each params as param (param.id)} -
- {#if param.type === 'checkbox'} - - {:else if param.type === 'number'} - - {:else if param.type === 'slider'} - - {:else if param.type === 'select'} - - {:else if param.type === 'color'} - onPipetteToggle?.(param.id)} - /> - {/if} -
-{/each} +
+ {#if hasMask} + + {/if} + {#each params as param (param.id)} +
+ {#if param.type === 'checkbox'} + + {:else if param.type === 'number'} + + {:else if param.type === 'slider'} + + {:else if param.type === 'select'} + + {:else if param.type === 'color'} + onPipetteToggle?.(param.id)} + /> + {/if} +
+ {/each} +
+ + diff --git a/web/src/lib/components/ToolPage.svelte b/web/src/lib/components/ToolPage.svelte index 4a7d78c..6ae70e2 100644 --- a/web/src/lib/components/ToolPage.svelte +++ b/web/src/lib/components/ToolPage.svelte @@ -258,24 +258,29 @@ {/if} -
- {#if !isSourceless} +
+
+ {#if !isSourceless} + +
+ {#if isTextSource && !source} + + {:else} + (errorText = message)} + onReset={reset} + pipetteActive={!!pipetteTargetId} + onPickColor={handlePickColor} + /> + {/if} +
+ {/if} +
- {#if isTextSource && !source} - - {:else} - (errorText = message)} - onReset={reset} - pipetteActive={!!pipetteTargetId} - onPickColor={handlePickColor} - /> - {/if} -
- {/if} -
- {#if (source || isSourceless) && !isInfo} -
- + {#if (source || isSourceless) && !isInfo && (tool.params.length > 0 || hasMask)} +
+
+ {/if} +
{#each chain as step, index (step.id)} @@ -357,8 +364,25 @@ margin-bottom: var(--space-3); } - .base-params { - margin-top: var(--space-4); + .tool-stage { + position: relative; + } + + .source-legend { + left: 25%; + transform: translateX(-50%); + } + + .result-legend { + left: 75%; + transform: translateX(-50%); + } + + @media (max-width: 48rem) { + .source-legend, + .result-legend { + display: none; + } } .empty-slot { diff --git a/web/src/lib/components/chain/ChainToolBlock.svelte b/web/src/lib/components/chain/ChainToolBlock.svelte index 50c8ea9..45117bb 100644 --- a/web/src/lib/components/chain/ChainToolBlock.svelte +++ b/web/src/lib/components/chain/ChainToolBlock.svelte @@ -40,28 +40,28 @@
-
-

Шаг {index + 1}: {tool.title}

- -
+
+ + Шаг {index + 1}: {tool.title} + + -
-

Вход

+
-

Результат

+ {#if busy && !result}
@@ -89,30 +89,38 @@
- + {#if tool.params.length > 0} +
+ +
+ + {/if}
diff --git a/web/src/lib/components/ui/Field.svelte b/web/src/lib/components/ui/Field.svelte index a64df98..dfa0b97 100644 --- a/web/src/lib/components/ui/Field.svelte +++ b/web/src/lib/components/ui/Field.svelte @@ -13,17 +13,42 @@
- {@render children()} - {#if hint} -

{hint}

- {/if} +
+ {@render children()} + {#if hint} +

{hint}

+ {/if} +
diff --git a/web/src/lib/components/ui/SliderField.svelte b/web/src/lib/components/ui/SliderField.svelte index dd65ed3..d9ff20b 100644 --- a/web/src/lib/components/ui/SliderField.svelte +++ b/web/src/lib/components/ui/SliderField.svelte @@ -63,19 +63,21 @@ display: flex; align-items: center; gap: var(--space-1); - max-width: var(--control-max-width); + width: 100%; + max-width: 22rem; } input[type='range'] { flex: 1; - min-width: 0; + min-width: 3rem; accent-color: var(--accent); + margin: 0; } .step { flex: none; - width: 1.7rem; - height: 1.7rem; + width: 1.5rem; + height: 1.5rem; display: inline-flex; align-items: center; justify-content: center; @@ -84,7 +86,7 @@ border-radius: var(--radius-s); background: var(--surface); color: var(--text); - font-size: 0.9rem; + font-size: 0.85rem; line-height: 1; cursor: pointer; transition: