refactor: update pages and refs audit
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
<script lang="ts">
|
||||
import { Upload, Settings2, RotateCcw, ChevronDown } from "@lucide/svelte";
|
||||
import { Settings2, ChevronDown } from "@lucide/svelte";
|
||||
import WorkspaceLayout from "$lib/components/kit/WorkspaceLayout.svelte";
|
||||
import WorkspaceHeader from "./WorkspaceHeader.svelte";
|
||||
import SectionLabel from "$lib/components/kit/SectionLabel.svelte";
|
||||
import StepCard from "$lib/components/kit/StepCard.svelte";
|
||||
import Segmented from "$lib/components/kit/Segmented.svelte";
|
||||
import SliderField from "$lib/components/kit/SliderField.svelte";
|
||||
import ColorField from "$lib/components/kit/ColorField.svelte";
|
||||
import Toggle from "$lib/components/kit/Toggle.svelte";
|
||||
import IconButton from "$lib/components/kit/IconButton.svelte";
|
||||
import DownloadButton from "$lib/components/kit/DownloadButton.svelte";
|
||||
import Badge from "$lib/components/kit/Badge.svelte";
|
||||
import StatusDot from "$lib/components/kit/StatusDot.svelte";
|
||||
import FieldGrid from "$lib/components/kit/FieldGrid.svelte";
|
||||
import MonoLabel from "$lib/components/kit/MonoLabel.svelte";
|
||||
import MetaList from "$lib/components/kit/MetaList.svelte";
|
||||
import ColorField from "$lib/components/kit/ColorField.svelte";
|
||||
import SliderField from "$lib/components/kit/SliderField.svelte";
|
||||
import Segmented from "$lib/components/kit/Segmented.svelte";
|
||||
import ToggleRow from "$lib/components/kit/ToggleRow.svelte";
|
||||
import PreviewStack from "$lib/components/kit/PreviewStack.svelte";
|
||||
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
||||
import CheckerCanvas from "$lib/components/kit/CheckerCanvas.svelte";
|
||||
import DownloadButton from "$lib/components/kit/DownloadButton.svelte";
|
||||
import MetaList from "$lib/components/kit/MetaList.svelte";
|
||||
import IconButton from "$lib/components/kit/IconButton.svelte";
|
||||
import PipelineFooter from "$lib/components/kit/PipelineFooter.svelte";
|
||||
|
||||
let gradColor = $state("#DCEBFF");
|
||||
let direction = $state(135);
|
||||
@@ -56,31 +61,28 @@
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
</svelte:head>
|
||||
|
||||
<div class="page-grid">
|
||||
<section class="workspace">
|
||||
<div class="eyebrow">PNG PROCESSING <span>/</span> WORKSPACE</div>
|
||||
<div class="title-row">
|
||||
<div>
|
||||
<h1>Build your image pipeline.</h1>
|
||||
<p class="lede">
|
||||
Chain simple tools together. Every change is processed automatically
|
||||
and previewed at each stage.
|
||||
</p>
|
||||
</div>
|
||||
<div class="file-chip">
|
||||
<Upload size={15} />
|
||||
<span>source.png</span>
|
||||
<b>1.8 MB</b>
|
||||
</div>
|
||||
</div>
|
||||
<WorkspaceLayout
|
||||
columns="minmax(0, 1.05fr) minmax(520px, 0.95fr)"
|
||||
gap="56px"
|
||||
padding="60px clamp(24px, 4vw, 72px) 72px"
|
||||
maxWidth="none"
|
||||
stickyTop="24px"
|
||||
padMobile="36px 16px 48px"
|
||||
>
|
||||
{#snippet settings()}
|
||||
<WorkspaceHeader
|
||||
eyebrowA="PNG PROCESSING"
|
||||
eyebrowB="WORKSPACE"
|
||||
title="Build your image pipeline."
|
||||
lede="Chain simple tools together. Every change is processed automatically and previewed at each stage."
|
||||
file={{ name: "source.png", size: "1.8 MB" }}
|
||||
/>
|
||||
|
||||
<div class="pipeline-head">
|
||||
<div>
|
||||
<span class="label">PROCESSING PIPELINE</span>
|
||||
<strong>4 active steps <em>• LIVE</em></strong>
|
||||
</div>
|
||||
<button class="add-btn" onclick={() => {}}>+ Add tool</button>
|
||||
</div>
|
||||
<SectionLabel label="PROCESSING PIPELINE" title="4 active steps" meta="• LIVE">
|
||||
{#snippet actions()}
|
||||
<button class="add-btn" onclick={() => {}}>+ Add tool</button>
|
||||
{/snippet}
|
||||
</SectionLabel>
|
||||
|
||||
<div class="steps-list">
|
||||
<StepCard
|
||||
@@ -90,11 +92,8 @@
|
||||
onremove={() => {}}
|
||||
>
|
||||
<div class="step-tools"><Badge tone="success">AUTO</Badge></div>
|
||||
<div class="controls">
|
||||
<div class="control-block">
|
||||
<MonoLabel>COLOR</MonoLabel>
|
||||
<ColorField label="Gradient color" bind:value={gradColor} />
|
||||
</div>
|
||||
<FieldGrid>
|
||||
<ColorField label="Gradient color" bind:value={gradColor} />
|
||||
<SliderField
|
||||
label="DIRECTION"
|
||||
bind:value={direction}
|
||||
@@ -114,7 +113,7 @@
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</FieldGrid>
|
||||
</StepCard>
|
||||
|
||||
<StepCard
|
||||
@@ -129,22 +128,16 @@
|
||||
|
||||
<StepCard index={3} type="STYLE" title="Add outline" onremove={() => {}}>
|
||||
<div class="step-tools"><Badge tone="success">AUTO</Badge></div>
|
||||
<div class="controls compact">
|
||||
<div class="control-block">
|
||||
<MonoLabel>WIDTH</MonoLabel>
|
||||
<SliderField
|
||||
label="Outline width"
|
||||
bind:value={outlineWidth}
|
||||
min={0}
|
||||
max={8}
|
||||
suffix="px"
|
||||
/>
|
||||
</div>
|
||||
<div class="control-block">
|
||||
<MonoLabel>COLOR</MonoLabel>
|
||||
<ColorField label="Outline color" bind:value={outlineColor} />
|
||||
</div>
|
||||
</div>
|
||||
<FieldGrid compact>
|
||||
<SliderField
|
||||
label="Outline width"
|
||||
bind:value={outlineWidth}
|
||||
min={0}
|
||||
max={8}
|
||||
suffix="px"
|
||||
/>
|
||||
<ColorField label="Outline color" bind:value={outlineColor} />
|
||||
</FieldGrid>
|
||||
</StepCard>
|
||||
|
||||
<StepCard
|
||||
@@ -154,177 +147,79 @@
|
||||
onremove={() => {}}
|
||||
>
|
||||
<div class="step-tools"><Badge tone="success">AUTO</Badge></div>
|
||||
<div class="controls compact">
|
||||
<div class="control-block">
|
||||
<MonoLabel>RADIUS</MonoLabel>
|
||||
<SliderField
|
||||
label="Corner radius"
|
||||
bind:value={radius}
|
||||
min={0}
|
||||
max={48}
|
||||
suffix="px"
|
||||
/>
|
||||
</div>
|
||||
<label class="toggle-row">
|
||||
<span>Preserve aspect ratio</span>
|
||||
<Toggle
|
||||
bind:checked={preserveAspect}
|
||||
label="Preserve aspect ratio"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<FieldGrid compact>
|
||||
<SliderField
|
||||
label="Corner radius"
|
||||
bind:value={radius}
|
||||
min={0}
|
||||
max={48}
|
||||
suffix="px"
|
||||
/>
|
||||
<ToggleRow label="Preserve aspect ratio" bind:checked={preserveAspect} />
|
||||
</FieldGrid>
|
||||
</StepCard>
|
||||
</div>
|
||||
|
||||
<div class="pipeline-footer">
|
||||
<button class="reset-btn" onclick={() => {}}>
|
||||
<RotateCcw size={14} /> Reset pipeline
|
||||
</button>
|
||||
<span class="auto-note"
|
||||
><StatusDot /> changes are applied automatically</span
|
||||
>
|
||||
</div>
|
||||
</section>
|
||||
<PipelineFooter onreset={() => {}} />
|
||||
{/snippet}
|
||||
|
||||
<section class="preview-panel">
|
||||
<div class="preview-top">
|
||||
<div>
|
||||
<span class="label">PIPELINE OUTPUTS</span>
|
||||
<strong>Visual history</strong>
|
||||
</div>
|
||||
<div class="preview-actions">
|
||||
<button class="history-toggle" onclick={() => {}}>
|
||||
Hide intermediate <ChevronDown size={15} />
|
||||
</button>
|
||||
<DownloadButton
|
||||
label="Download result"
|
||||
size="1.2 MB"
|
||||
onclick={() => {}}
|
||||
/>
|
||||
<MetaList
|
||||
items={[
|
||||
{ caption: "DIMENSIONS", value: "1200 × 800 px" },
|
||||
{ caption: "FORMAT", value: "PNG-24" },
|
||||
{ caption: "SIZE", value: "1.2 MB" },
|
||||
]}
|
||||
/>
|
||||
<IconButton
|
||||
icon={Settings2}
|
||||
label="Preview settings"
|
||||
onclick={() => {}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{#snippet preview()}
|
||||
<div class="preview-panel">
|
||||
<SectionLabel label="PIPELINE OUTPUTS" title="Visual history">
|
||||
{#snippet actions()}
|
||||
<button class="history-toggle" onclick={() => {}}>
|
||||
Hide intermediate <ChevronDown size={15} />
|
||||
</button>
|
||||
<DownloadButton
|
||||
label="Download result"
|
||||
size="1.2 MB"
|
||||
onclick={() => {}}
|
||||
/>
|
||||
<MetaList
|
||||
items={[
|
||||
{ caption: "DIMENSIONS", value: "1200 × 800 px" },
|
||||
{ caption: "FORMAT", value: "PNG-24" },
|
||||
{ caption: "SIZE", value: "1.2 MB" },
|
||||
]}
|
||||
/>
|
||||
<IconButton
|
||||
icon={Settings2}
|
||||
label="Preview settings"
|
||||
onclick={() => {}}
|
||||
/>
|
||||
{/snippet}
|
||||
</SectionLabel>
|
||||
|
||||
<div class="preview-stack">
|
||||
{#each previewTiles as tile (tile.label)}
|
||||
<PreviewTile label={tile.label}>
|
||||
<CheckerCanvas size="large">
|
||||
<div
|
||||
class="ph"
|
||||
class:active={tile.active}
|
||||
style="background:{tile.bg}; border-radius:{tile.radius ??
|
||||
'0'}; box-shadow:{tile.ring ?? 'none'};"
|
||||
>
|
||||
<span class="sample-icon">PNG</span>
|
||||
<span>easy-png-tools</span>
|
||||
<PreviewStack pad="16px 0">
|
||||
{#each previewTiles as tile (tile.label)}
|
||||
<PreviewTile label={tile.label}>
|
||||
<CheckerCanvas size="large">
|
||||
<div
|
||||
class="ph"
|
||||
class:active={tile.active}
|
||||
style="background:{tile.bg}; border-radius:{tile.radius ??
|
||||
'0'}; box-shadow:{tile.ring ?? 'none'};"
|
||||
>
|
||||
<span class="sample-icon">PNG</span>
|
||||
<span>easy-png-tools</span>
|
||||
</div>
|
||||
</CheckerCanvas>
|
||||
<div class="tile-label-wrap">
|
||||
<span class="tile-label">{tile.label}</span>
|
||||
<span class="tile-caption">{tile.caption}</span>
|
||||
</div>
|
||||
</CheckerCanvas>
|
||||
<div class="tile-label-wrap">
|
||||
<span class="tile-label">{tile.label}</span>
|
||||
<span class="tile-caption">{tile.caption}</span>
|
||||
</div>
|
||||
</PreviewTile>
|
||||
{/each}
|
||||
</div>
|
||||
</PreviewTile>
|
||||
{/each}
|
||||
</PreviewStack>
|
||||
|
||||
<p class="preview-note">
|
||||
Output is generated in-browser. Your files never leave this device.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
<p class="preview-note">
|
||||
Output is generated in-browser. Your files never leave this device.
|
||||
</p>
|
||||
</div>
|
||||
{/snippet}
|
||||
</WorkspaceLayout>
|
||||
|
||||
<style>
|
||||
.page-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.05fr) minmax(520px, 0.95fr);
|
||||
align-items: start;
|
||||
gap: 56px;
|
||||
max-width: none;
|
||||
margin: auto;
|
||||
padding: 60px clamp(24px, 4vw, 72px) 72px;
|
||||
}
|
||||
.workspace {
|
||||
min-width: 0;
|
||||
}
|
||||
.eyebrow {
|
||||
font: 10px var(--font-mono);
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--muted);
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.eyebrow span {
|
||||
margin: 0 7px;
|
||||
color: var(--blue);
|
||||
}
|
||||
.title-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
gap: 30px;
|
||||
margin-bottom: 56px;
|
||||
}
|
||||
h1 {
|
||||
margin: 0 0 16px;
|
||||
font-size: clamp(36px, 4vw, 64px);
|
||||
font-weight: 650;
|
||||
letter-spacing: -0.06em;
|
||||
color: var(--foreground);
|
||||
}
|
||||
.lede {
|
||||
margin: 0;
|
||||
max-width: 550px;
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
.file-chip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
white-space: nowrap;
|
||||
border: 1px solid var(--line);
|
||||
background: var(--panel);
|
||||
font: 11px var(--font-mono);
|
||||
color: var(--muted);
|
||||
padding: 10px 12px;
|
||||
}
|
||||
.file-chip b {
|
||||
color: var(--blue);
|
||||
font-weight: 500;
|
||||
}
|
||||
.pipeline-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.label {
|
||||
font: 10px var(--font-mono);
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--muted);
|
||||
}
|
||||
.pipeline-head strong {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
font: 600 14px var(--font-mono);
|
||||
color: var(--foreground);
|
||||
}
|
||||
.pipeline-head em {
|
||||
color: #25a96a;
|
||||
font-style: normal;
|
||||
font-size: 10px;
|
||||
}
|
||||
.add-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -345,14 +240,6 @@
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
.controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1.1fr 1fr 1.2fr;
|
||||
gap: 16px;
|
||||
}
|
||||
.controls.compact {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.control-block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -365,66 +252,12 @@
|
||||
color: var(--muted);
|
||||
font: 11px var(--font-mono);
|
||||
}
|
||||
.toggle-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 15px;
|
||||
color: var(--foreground);
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.pipeline-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 18px;
|
||||
}
|
||||
.reset-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
color: var(--blue);
|
||||
background: none;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
.auto-note {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: var(--muted);
|
||||
font: 11px var(--font-mono);
|
||||
}
|
||||
.preview-panel {
|
||||
position: sticky;
|
||||
top: 24px;
|
||||
border: 1px solid var(--line);
|
||||
background: var(--panel);
|
||||
padding: 18px;
|
||||
min-width: 0;
|
||||
}
|
||||
.preview-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding-bottom: 15px;
|
||||
gap: 16px;
|
||||
}
|
||||
.preview-top strong {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
font: 600 14px var(--font-mono);
|
||||
}
|
||||
.preview-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
.history-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -444,12 +277,6 @@
|
||||
color: var(--foreground);
|
||||
background: var(--background);
|
||||
}
|
||||
.preview-stack {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
padding: 16px 0;
|
||||
}
|
||||
.ph {
|
||||
width: 80%;
|
||||
aspect-ratio: 1.35;
|
||||
@@ -489,25 +316,4 @@
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.page-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 24px;
|
||||
padding: 36px 16px 48px;
|
||||
}
|
||||
.title-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.preview-panel {
|
||||
position: static;
|
||||
}
|
||||
.controls,
|
||||
.controls.compact {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.preview-stack {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,30 +6,14 @@
|
||||
defaultParams,
|
||||
isChainable,
|
||||
TOOLS,
|
||||
type ParamDef,
|
||||
} from "$lib/registry";
|
||||
import { encode, downloadBlob, toDataUrl, decodeBytes } from "$lib/core/io";
|
||||
import type { PixelImage } from "$lib/core/types";
|
||||
import Panel from "$lib/components/kit/Panel.svelte";
|
||||
import PanelHeading from "$lib/components/kit/PanelHeading.svelte";
|
||||
import SettingsFooter from "$lib/components/kit/SettingsFooter.svelte";
|
||||
import ColorField from "$lib/components/kit/ColorField.svelte";
|
||||
import SliderField from "$lib/components/kit/SliderField.svelte";
|
||||
import SelectField from "$lib/components/kit/SelectField.svelte";
|
||||
import Toggle from "$lib/components/kit/Toggle.svelte";
|
||||
import TextField from "$lib/components/kit/TextField.svelte";
|
||||
import NumberField from "$lib/components/kit/NumberField.svelte";
|
||||
import CheckerCanvas from "$lib/components/kit/CheckerCanvas.svelte";
|
||||
import MetaList from "$lib/components/kit/MetaList.svelte";
|
||||
import DownloadButton from "$lib/components/kit/DownloadButton.svelte";
|
||||
import Badge from "$lib/components/kit/Badge.svelte";
|
||||
import StatusLine from "$lib/components/kit/StatusLine.svelte";
|
||||
import WorkspaceLayout from "$lib/components/kit/WorkspaceLayout.svelte";
|
||||
import EmptyState from "$lib/components/kit/EmptyState.svelte";
|
||||
import Button from "$lib/components/kit/Button.svelte";
|
||||
import Dropzone from "$lib/components/kit/Dropzone.svelte";
|
||||
import StepCard from "$lib/components/kit/StepCard.svelte";
|
||||
import PreviewTile from "$lib/components/kit/PreviewTile.svelte";
|
||||
import { SlidersHorizontal as ToolIcon } from "@lucide/svelte";
|
||||
import SettingsPanel from "./SettingsPanel.svelte";
|
||||
import PreviewPanel from "./PreviewPanel.svelte";
|
||||
|
||||
type ParamValue = string | number | boolean;
|
||||
|
||||
@@ -221,59 +205,8 @@
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
</svelte:head>
|
||||
|
||||
{#snippet control(
|
||||
p: ParamDef,
|
||||
value: ParamValue,
|
||||
onInput: (v: ParamValue) => void,
|
||||
)}
|
||||
{#if p.type === "color"}
|
||||
<ColorField
|
||||
label={p.label}
|
||||
value={value as string}
|
||||
oninput={(v) => onInput(v)}
|
||||
/>
|
||||
{:else if p.type === "slider"}
|
||||
<SliderField
|
||||
label={p.label}
|
||||
value={value as number}
|
||||
min={p.min}
|
||||
max={p.max}
|
||||
step={p.step}
|
||||
oninput={(v) => onInput(v)}
|
||||
/>
|
||||
{:else if p.type === "select"}
|
||||
<SelectField
|
||||
label={p.label}
|
||||
value={value as string}
|
||||
options={p.options}
|
||||
onchange={(v) => onInput(v)}
|
||||
/>
|
||||
{:else if p.type === "checkbox"}
|
||||
<label class="toggle-row"
|
||||
><span>{p.label}</span>
|
||||
<Toggle checked={value as boolean} onchange={(v) => onInput(v)} /></label
|
||||
>
|
||||
{:else if p.type === "text"}
|
||||
<TextField
|
||||
label={p.label}
|
||||
value={value as string}
|
||||
placeholder={p.placeholder}
|
||||
oninput={(v) => onInput(v)}
|
||||
/>
|
||||
{:else if p.type === "number"}
|
||||
<NumberField
|
||||
label={p.label}
|
||||
value={value as number}
|
||||
min={p.min}
|
||||
max={p.max}
|
||||
step={p.step}
|
||||
oninput={(v) => onInput(v)}
|
||||
/>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#if !firstTool}
|
||||
<div class="tool-grid">
|
||||
<div class="notfound">
|
||||
<EmptyState
|
||||
title="Tool not found"
|
||||
description="No tool is registered under “{data.id}”."
|
||||
@@ -281,171 +214,47 @@
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="tool-grid">
|
||||
<section class="pipeline-panel">
|
||||
<Panel>
|
||||
<PanelHeading title="Pipeline" eyebrow="STEPS">
|
||||
{#snippet actions()}
|
||||
<Badge tone="accent">AUTO</Badge>
|
||||
{/snippet}
|
||||
</PanelHeading>
|
||||
<div class="pipeline-body">
|
||||
{#if steps.length === 0}
|
||||
<EmptyState
|
||||
title="Pipeline empty"
|
||||
description="Add a tool step below."
|
||||
/>
|
||||
{/if}
|
||||
{#each steps as step, i (step.toolId + i)}
|
||||
{@const st = getTool(step.toolId)}
|
||||
<StepCard
|
||||
index={i + 1}
|
||||
title={st?.title ?? step.toolId}
|
||||
type={st?.category}
|
||||
onremove={() => removeStep(i)}
|
||||
>
|
||||
{#if st}
|
||||
<div class="step-controls">
|
||||
{#each st.params as p (p.id)}
|
||||
{@render control(p, step.params[p.id] as ParamValue, (v) =>
|
||||
setStepParam(i, p.id, v),
|
||||
)}
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</StepCard>
|
||||
{/each}
|
||||
</div>
|
||||
<SettingsFooter>
|
||||
<div class="add-step">
|
||||
<SelectField
|
||||
label="Add step"
|
||||
value={addId}
|
||||
options={chainOptions}
|
||||
onchange={(v) => (addId = v)}
|
||||
/>
|
||||
<Button variant="ghost" onclick={addStep}>Add step</Button>
|
||||
</div>
|
||||
</SettingsFooter>
|
||||
</Panel>
|
||||
</section>
|
||||
|
||||
<section class="preview-panel">
|
||||
<Panel>
|
||||
<PanelHeading title="Pipeline output" eyebrow="RESULT">
|
||||
{#snippet actions()}
|
||||
{#if resultUrl}
|
||||
<DownloadButton
|
||||
label="Download result"
|
||||
onclick={downloadResult}
|
||||
/>
|
||||
{/if}
|
||||
{/snippet}
|
||||
</PanelHeading>
|
||||
<div class="preview-body">
|
||||
{#if chainError}
|
||||
<EmptyState title="Pipeline failed" description={chainError} />
|
||||
{/if}
|
||||
{#if needsSource && !sourceImg}
|
||||
<Dropzone onfile={onFile} />
|
||||
{:else if needsSource && sourceImg}
|
||||
<Button variant="ghost" onclick={clearSource}>Change image</Button>
|
||||
{/if}
|
||||
<div class="preview-stack">
|
||||
{#if needsSource && sourceImg}
|
||||
<PreviewTile label="SOURCE">
|
||||
<CheckerCanvas size="sm">
|
||||
<img class="tile-img" src={sourceUrl} alt="source" />
|
||||
</CheckerCanvas>
|
||||
</PreviewTile>
|
||||
{/if}
|
||||
{#each stepOutputs as out, i (out.toolId + i)}
|
||||
<PreviewTile label={`STEP ${String(i + 1).padStart(2, "0")}`}>
|
||||
<CheckerCanvas size="sm">
|
||||
<img class="tile-img" src={out.url} alt={out.title} />
|
||||
</CheckerCanvas>
|
||||
</PreviewTile>
|
||||
{/each}
|
||||
</div>
|
||||
{#if processing}
|
||||
<StatusLine label="processing pipeline" />
|
||||
{/if}
|
||||
<MetaList items={resultMeta} />
|
||||
</div>
|
||||
</Panel>
|
||||
</section>
|
||||
</div>
|
||||
<WorkspaceLayout
|
||||
columns="minmax(0, 1fr) minmax(0, 1.1fr)"
|
||||
gap="40px"
|
||||
padding="48px clamp(24px, 4vw, 72px) 72px"
|
||||
maxWidth="1680px"
|
||||
stickyTop="84px"
|
||||
padMobile="32px 16px 48px"
|
||||
>
|
||||
{#snippet settings()}
|
||||
<SettingsPanel
|
||||
{steps}
|
||||
{chainOptions}
|
||||
{addId}
|
||||
onAddStep={addStep}
|
||||
onSetAddId={(v) => (addId = v)}
|
||||
onRemoveStep={removeStep}
|
||||
onSetParam={setStepParam}
|
||||
/>
|
||||
{/snippet}
|
||||
{#snippet preview()}
|
||||
<PreviewPanel
|
||||
{needsSource}
|
||||
{sourceImg}
|
||||
{sourceUrl}
|
||||
{stepOutputs}
|
||||
{resultUrl}
|
||||
{resultMeta}
|
||||
{processing}
|
||||
{chainError}
|
||||
onFile={onFile}
|
||||
onClearSource={clearSource}
|
||||
onDownload={downloadResult}
|
||||
/>
|
||||
{/snippet}
|
||||
</WorkspaceLayout>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.tool-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
|
||||
align-items: start;
|
||||
gap: 40px;
|
||||
.notfound {
|
||||
max-width: 1680px;
|
||||
margin: 0 auto;
|
||||
padding: 48px clamp(24px, 4vw, 72px) 72px;
|
||||
}
|
||||
.pipeline-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.step-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
.toggle-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
color: var(--foreground);
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.add-step {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
.add-step :global(.select-field),
|
||||
.add-step :global(select) {
|
||||
min-width: 0;
|
||||
}
|
||||
.preview-panel {
|
||||
position: sticky;
|
||||
top: 84px;
|
||||
}
|
||||
.preview-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
.preview-stack {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.tile-img {
|
||||
max-width: 100%;
|
||||
max-height: 220px;
|
||||
display: block;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.tool-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 24px;
|
||||
padding: 32px 16px 48px;
|
||||
}
|
||||
.preview-panel {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user