redesign capture and settings
This commit is contained in:
+133
-524
@@ -1,15 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte"
|
||||
import { IconActivity, IconAdjustmentsHorizontal, IconFileExport, IconFolder, IconKeyboard, IconScan } from "./ui/icons"
|
||||
import WindowBar from "./ui/WindowBar.svelte"
|
||||
import WorkspaceScroll from "./ui/WorkspaceScroll.svelte"
|
||||
import Dropdown from "./ui/Dropdown.svelte"
|
||||
import Toggle from "./ui/Toggle.svelte"
|
||||
import { appear, disclosure } from "./ui/motion"
|
||||
import { scrollbar } from "./ui/scrollbar"
|
||||
import { api, type Config, type CodecAvailability, type DiagnosticsInfo } from "./api"
|
||||
import HotkeyInput from "./HotkeyInput.svelte"
|
||||
import { open } from "@tauri-apps/plugin-dialog"
|
||||
|
||||
let { onClose }: { onClose: () => void } = $props()
|
||||
let { onClose, onCheckUpdates }: { onClose: () => void; onCheckUpdates: () => void } = $props()
|
||||
|
||||
let cfg: Config | null = $state(null)
|
||||
let saving: boolean = $state(false)
|
||||
let hotkeyWarnings: string[] = $state([])
|
||||
let showAdvanced: boolean = $state(false)
|
||||
let activeTab: string = $state("capture")
|
||||
let initialCfg: Config | null = $state(null)
|
||||
let codecs: CodecAvailability | null = $state(null)
|
||||
@@ -36,13 +42,34 @@
|
||||
let diagnostics: DiagnosticsInfo | null = $state(null)
|
||||
|
||||
const TABS = [
|
||||
{ id: "capture", label: "Capture" },
|
||||
{ id: "export", label: "Export" },
|
||||
{ id: "hotkeys", label: "Hotkeys" },
|
||||
{ id: "output", label: "Output" },
|
||||
{ id: "system", label: "System" },
|
||||
{ id: "diagnostics", label: "Diagnostics" },
|
||||
{ id: "capture", label: "Capture", icon: IconScan },
|
||||
{ id: "export", label: "Export", icon: IconFileExport },
|
||||
{ id: "hotkeys", label: "Shortcuts", icon: IconKeyboard },
|
||||
{ id: "output", label: "Files", icon: IconFolder },
|
||||
{ id: "system", label: "System", icon: IconAdjustmentsHorizontal },
|
||||
{ id: "diagnostics", label: "Diagnostics", icon: IconActivity },
|
||||
]
|
||||
const descriptions: Record<string, string> = {
|
||||
capture: "Choose defaults for new recordings.",
|
||||
export: "Set format and encoding defaults for new clips.",
|
||||
hotkeys: "Control recording while ByteSize is in the background.",
|
||||
output: "Set where new exports are saved.",
|
||||
system: "Manage appearance and app updates.",
|
||||
diagnostics: "Check encoder availability and review recent activity.",
|
||||
}
|
||||
const rates = [1,2,5,10,15,24,30,60].map(value => ({value,label:value+" FPS"}))
|
||||
const qualities = [{value:"auto",label:"Auto"},{value:"full",label:"Full"}] as const
|
||||
const formats = [{value:"mp4",label:"MP4"},{value:"webm",label:"WebM"},{value:"gif",label:"GIF"}] as const
|
||||
const dithers = [{value:"floyd_steinberg",label:"Floyd-Steinberg"},{value:"bayer",label:"Bayer"},{value:"none",label:"None"}] as const
|
||||
const themes = [{value:"dark",label:"Dark"},{value:"light",label:"Light"}] as const
|
||||
let mp4 = $derived.by(() => [
|
||||
{value:"h264",label:codecs?.h264 === false ? "H.264 unavailable" : "H.264",disabled:codecs?.h264 === false},
|
||||
{value:"h265",label:codecs?.h265 === false ? "H.265 unavailable" : "H.265",disabled:codecs?.h265 === false},
|
||||
] as const)
|
||||
let webm = $derived.by(() => [
|
||||
{value:"vp9",label:codecs?.vp9 === false ? "VP9 unavailable" : "VP9",disabled:codecs?.vp9 === false},
|
||||
{value:"av1",label:codecs?.av1 === false ? "AV1 unavailable" : "AV1",disabled:codecs?.av1 === false},
|
||||
] as const)
|
||||
|
||||
onMount(async () => {
|
||||
cfg = await api.getConfig()
|
||||
@@ -87,7 +114,7 @@
|
||||
if (result.hotkey_result.stop_ok === false) failed.push("stop")
|
||||
if (result.hotkey_result.pause_ok === false) failed.push("pause")
|
||||
if (failed.length > 0) {
|
||||
hotkeyWarnings = [`${failed.join(", ")} - hotkey may be in use by another app`]
|
||||
hotkeyWarnings = [`Could not register the ${failed.join(", ")} shortcuts. Your settings were kept.`]
|
||||
} else {
|
||||
initialCfg = $state.snapshot(cfg)
|
||||
onClose()
|
||||
@@ -97,6 +124,12 @@
|
||||
} finally { saving = false }
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
if (saving) return
|
||||
if (initialCfg) document.documentElement.setAttribute("data-theme", initialCfg.theme)
|
||||
onClose()
|
||||
}
|
||||
|
||||
async function pickOutputDir() {
|
||||
if (!cfg) return
|
||||
try {
|
||||
@@ -108,527 +141,103 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="settings">
|
||||
<header class="settings-header">
|
||||
<div class="header-left">
|
||||
<button class="back-btn" onclick={onClose} aria-label="close settings">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="9,2 3,7 9,12"/>
|
||||
</svg>
|
||||
</button>
|
||||
<h1>Settings</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{#if cfg}
|
||||
<div class="settings-body">
|
||||
<!-- Tab nav -->
|
||||
<nav class="tab-nav" aria-label="settings categories">
|
||||
{#each TABS as t}
|
||||
<button
|
||||
class="tab"
|
||||
class:active={activeTab === t.id}
|
||||
aria-current={activeTab === t.id ? "true" : undefined}
|
||||
onclick={() => activeTab = t.id}
|
||||
>{t.label}</button>
|
||||
{/each}
|
||||
</nav>
|
||||
|
||||
<!-- Tab content -->
|
||||
<div class="tab-content">
|
||||
{#if activeTab === "capture"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>Capture</h2>
|
||||
<p class="panel-desc">Recording behavior and defaults</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<label class="field">
|
||||
<span class="field-label">Export FPS</span>
|
||||
<select bind:value={cfg.capture.default_fps}>
|
||||
{#each [15,24,30,60] as f}<option value={f}>{f} fps</option>{/each}
|
||||
</select>
|
||||
</label>
|
||||
<label class="field-check">
|
||||
<input type="checkbox" bind:checked={cfg.capture.limit_capture_fps} />
|
||||
<span>Cap capture at this rate</span>
|
||||
</label>
|
||||
{#if cfg.capture.limit_capture_fps}
|
||||
<p class="field-note">
|
||||
Recording stops at {cfg.capture.default_fps} fps instead of the display's refresh
|
||||
rate. Smaller temp files and less CPU, but nothing above that rate is captured.
|
||||
</p>
|
||||
{/if}
|
||||
<label class="field">
|
||||
<span class="field-label">Capture quality</span>
|
||||
<select bind:value={cfg.capture.capture_quality}>
|
||||
<option value="auto">Auto (cap 1920px, lower CPU)</option>
|
||||
<option value="full">Full (native res up to 3840px)</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field-check">
|
||||
<input type="checkbox" bind:checked={cfg.capture.capture_cursor} />
|
||||
<span>Capture cursor</span>
|
||||
</label>
|
||||
<label class="field-check">
|
||||
<input type="checkbox" bind:checked={cfg.capture.capture_audio} />
|
||||
<span>Capture system audio</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:else if activeTab === "export"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>Export</h2>
|
||||
<p class="panel-desc">Default format and encoding options</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<label class="field">
|
||||
<span class="field-label">Default format</span>
|
||||
<select bind:value={cfg.export.default_format}>
|
||||
<option value="gif">GIF</option>
|
||||
<option value="webm">WebM</option>
|
||||
<option value="mp4">MP4</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<button class="advanced-toggle" onclick={() => showAdvanced = !showAdvanced} aria-expanded={showAdvanced}>
|
||||
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class:rotated={showAdvanced}>
|
||||
<polyline points="2,3 5,6 8,3"/>
|
||||
</svg>
|
||||
Advanced codecs
|
||||
</button>
|
||||
|
||||
{#if showAdvanced}
|
||||
<label class="field">
|
||||
<span class="field-label">GIF dithering</span>
|
||||
<select bind:value={cfg.export.gif_dither}>
|
||||
<option value="floyd_steinberg">Floyd-Steinberg</option>
|
||||
<option value="bayer">Bayer</option>
|
||||
<option value="none">None</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span class="field-label">WebM codec</span>
|
||||
<select bind:value={cfg.export.webm_codec}>
|
||||
<option value="vp9" disabled={codecs ? !codecs.vp9 : false}>VP9 (default){codecs && !codecs.vp9 ? " - unavailable" : ""}</option>
|
||||
<option value="av1" disabled={codecs ? !codecs.av1 : false}>AV1 (smaller, slower){codecs && !codecs.av1 ? " - unavailable" : ""}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span class="field-label">MP4 codec</span>
|
||||
<select bind:value={cfg.export.mp4_codec}>
|
||||
<option value="h264" disabled={codecs ? !codecs.h264 : false}>H.264 (default){codecs && !codecs.h264 ? " - unavailable" : ""}</option>
|
||||
<option value="h265" disabled={codecs ? !codecs.h265 : false}>H.265 (smaller, less universal){codecs && !codecs.h265 ? " - unavailable" : ""}</option>
|
||||
</select>
|
||||
</label>
|
||||
{#if codecs && (!codecs.av1 || !codecs.h265)}
|
||||
<p class="field-note">Some codecs are unavailable in your ffmpeg build and disabled above.</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:else if activeTab === "hotkeys"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>Hotkeys</h2>
|
||||
<p class="panel-desc">Global keyboard shortcuts</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<label class="field">
|
||||
<span class="field-label">Start recording</span>
|
||||
<HotkeyInput bind:value={cfg.hotkeys.start} placeholder="e.g. F9" />
|
||||
</label>
|
||||
<label class="field">
|
||||
<span class="field-label">Stop recording</span>
|
||||
<HotkeyInput bind:value={cfg.hotkeys.stop} placeholder="e.g. F10" />
|
||||
</label>
|
||||
<label class="field">
|
||||
<span class="field-label">Pause / resume</span>
|
||||
<HotkeyInput bind:value={cfg.hotkeys.pause} placeholder="e.g. F11" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:else if activeTab === "output"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>Output</h2>
|
||||
<p class="panel-desc">Where exported files are saved</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<label class="field">
|
||||
<span class="field-label">Save folder</span>
|
||||
<div class="path-row">
|
||||
<input type="text" class="path-input" placeholder="./output" value={cfg.output_dir ?? ""} oninput={(e) => { cfg!.output_dir = (e.currentTarget as HTMLInputElement).value.trim() || null }} />
|
||||
<button class="btn-ghost" onclick={pickOutputDir}>Browse</button>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:else if activeTab === "system"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>System</h2>
|
||||
<p class="panel-desc">Appearance and updates</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<label class="field">
|
||||
<span class="field-label">Theme</span>
|
||||
<select bind:value={cfg.theme}>
|
||||
<option value="dark">Dark</option>
|
||||
<option value="light">Light</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field-check">
|
||||
<input type="checkbox" bind:checked={cfg.updates.check_on_launch} />
|
||||
<span>Check for updates on launch</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:else if activeTab === "diagnostics"}
|
||||
<div class="tab-panel">
|
||||
<div class="panel-head">
|
||||
<h2>Diagnostics</h2>
|
||||
<p class="panel-desc">Versions and recent log output</p>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
<div class="diag-row">
|
||||
<span class="field-label">ByteSize</span>
|
||||
<span class="diag-val mono">{diagnostics ? `v${diagnostics.app_version}` : "..."}</span>
|
||||
</div>
|
||||
<div class="diag-row">
|
||||
<span class="field-label">ffmpeg</span>
|
||||
<span class="diag-val mono">{diagnostics ? diagnostics.ffmpeg_version : "..."}</span>
|
||||
</div>
|
||||
<div class="diag-row">
|
||||
<span class="field-label">Log folder</span>
|
||||
<span class="diag-val mono">{diagnostics ? diagnostics.log_dir : "..."}</span>
|
||||
<button class="btn-ghost compact" onclick={openLogFolder} disabled={!diagnostics}>Open</button>
|
||||
</div>
|
||||
<div class="diag-tail-wrap">
|
||||
<div class="diag-tail-head">
|
||||
<span class="field-label">Recent log</span>
|
||||
<button class="link" onclick={refreshDiagnostics}>Refresh</button>
|
||||
</div>
|
||||
<pre class="diag-tail">{diagnostics ? diagnostics.log_tail || "(empty)" : "loading..."}</pre>
|
||||
<WindowBar current="settings" onCapture={cancel} onSettings={cancel} disabled={saving} />
|
||||
<WorkspaceScroll>
|
||||
{#if cfg}
|
||||
<section class="settings-workspace">
|
||||
<nav class="settings-nav" aria-label="Settings sections">
|
||||
<h3>Settings</h3>
|
||||
{#each TABS as tab}
|
||||
<button type="button" class="button ghost" aria-current={activeTab === tab.id ? "true" : undefined}
|
||||
onclick={() => activeTab = tab.id}><tab.icon size={17} />{tab.label}</button>
|
||||
{/each}
|
||||
</nav>
|
||||
{#key activeTab}
|
||||
<div class="settings-pane" use:appear>
|
||||
<header>
|
||||
<h1>{TABS.find(tab => tab.id === activeTab)?.label}</h1>
|
||||
<p class="note">{descriptions[activeTab]}</p>
|
||||
</header>
|
||||
<div class="settings-fields">
|
||||
{#if activeTab === "capture"}
|
||||
<div class="setting-row"><div><strong>Export frame rate</strong><p class="note">Preselected when you finish a recording.</p></div><Dropdown label="Default export frame rate" options={rates} bind:value={cfg.capture.default_fps} disabled={saving} /></div>
|
||||
<div class="setting-row"><div><strong>Limit capture frame rate</strong><p class="note">Record at the selected rate instead of the display rate.</p></div><Toggle label="Limit capture frame rate" bind:checked={cfg.capture.limit_capture_fps} disabled={saving} /></div>
|
||||
<div class="setting-row"><div><strong>Resolution</strong><p class="note">Auto caps the longest side at 1920 px.</p></div><Dropdown label="Default capture resolution" options={qualities} bind:value={cfg.capture.capture_quality} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>Record mouse pointer</strong><Toggle label="Record mouse pointer" bind:checked={cfg.capture.capture_cursor} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>Record system audio</strong><Toggle label="Record system audio" bind:checked={cfg.capture.capture_audio} disabled={saving} /></div>
|
||||
{:else if activeTab === "export"}
|
||||
<div class="setting-row"><div><strong>Default format</strong><p class="note">Preselected when you finish a recording.</p></div><Dropdown label="Default format" options={formats} bind:value={cfg.export.default_format} disabled={saving} /></div>
|
||||
<details class="advanced" use:disclosure><summary>Advanced encoding</summary>
|
||||
<div class="disclosure-body">
|
||||
<div class="setting-row"><strong>GIF dithering</strong><Dropdown label="Default GIF dithering" options={dithers} bind:value={cfg.export.gif_dither} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>MP4 codec</strong><Dropdown label="MP4 codec" options={mp4} bind:value={cfg.export.mp4_codec} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>WebM codec</strong><Dropdown label="WebM codec" options={webm} bind:value={cfg.export.webm_codec} disabled={saving} /></div>
|
||||
</div>
|
||||
</details>
|
||||
{:else if activeTab === "hotkeys"}
|
||||
<div class="setting-row"><strong>Start recording</strong><HotkeyInput label="Start recording" bind:value={cfg.hotkeys.start} placeholder="Assign" /></div>
|
||||
<div class="setting-row"><strong>Stop recording</strong><HotkeyInput label="Stop recording" bind:value={cfg.hotkeys.stop} placeholder="Assign" /></div>
|
||||
<div class="setting-row"><strong>Pause / resume</strong><HotkeyInput label="Pause or resume" bind:value={cfg.hotkeys.pause} placeholder="Assign" /></div>
|
||||
{:else if activeTab === "output"}
|
||||
<div class="setting-row"><label for="default-output"><strong>Default output folder</strong></label>
|
||||
<input id="default-output" class="field mono folder" placeholder="Default output folder" value={cfg.output_dir ?? ""} oninput={e => { cfg!.output_dir = e.currentTarget.value.trim() || null }} disabled={saving} />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if hotkeyWarnings.length > 0}
|
||||
<div class="warn-block" role="alert">
|
||||
{#each hotkeyWarnings as w}<p>{w}</p>{/each}
|
||||
<div class="warn-actions">
|
||||
<button class="btn-warn" onclick={save} disabled={saving}>Try again</button>
|
||||
<button class="btn-ghost" onclick={onClose}>Cancel</button>
|
||||
<div class="setting-row"><strong>Choose location</strong><button type="button" class="button" onclick={pickOutputDir} disabled={saving}><IconFolder size={17} />Browse</button></div>
|
||||
{:else if activeTab === "system"}
|
||||
<div class="setting-row"><strong>Appearance</strong><Dropdown label="Appearance" options={themes} bind:value={cfg.theme} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>Check for updates on launch</strong><Toggle label="Check for updates on launch" bind:checked={cfg.updates.check_on_launch} disabled={saving} /></div>
|
||||
<div class="setting-row"><strong>App updates</strong><button type="button" class="button" onclick={onCheckUpdates} disabled={saving}>Check for updates</button></div>
|
||||
{:else}
|
||||
<div class="setting-row"><strong>ByteSize</strong><code class="mono selectable">{diagnostics?.app_version ?? "Loading..."}</code></div>
|
||||
<div class="setting-row"><strong>Encoder</strong><code class="mono selectable">{diagnostics?.ffmpeg_version ?? "Loading..."}</code></div>
|
||||
<div class="setting-row"><div><strong>Log folder</strong><p class="note log-path selectable">{diagnostics?.log_dir ?? ""}</p></div>
|
||||
<button type="button" class="button" onclick={openLogFolder} disabled={!diagnostics}><IconFolder size={17} />Show logs</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else if activeTab !== "diagnostics"}
|
||||
<div class="panel-foot">
|
||||
<button class="btn-primary" onclick={save} disabled={saving}>
|
||||
{saving ? "Saving" : "Save changes"}
|
||||
</button>
|
||||
{#if dirty}<span class="unsaved-dot" title="unsaved changes"></span>{/if}
|
||||
<button class="btn-ghost" onclick={onClose}>Cancel</button>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="panel-foot">
|
||||
<button class="btn-ghost" onclick={onClose}>Close</button>
|
||||
</div>
|
||||
<div class="row between"><h3>Recent activity</h3><button type="button" class="button ghost" onclick={refreshDiagnostics}>Refresh</button></div>
|
||||
<div class="log-scroll"><pre class="mono" use:scrollbar={"y"}>{diagnostics?.log_tail || "No recent log entries."}</pre></div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if hotkeyWarnings.length}
|
||||
<div class="notice problem warnings" role="alert" use:appear>{#each hotkeyWarnings as warning}<p>{warning}</p>{/each}</div>
|
||||
{/if}
|
||||
<div class="actions wrap setting-footer">
|
||||
{#if activeTab !== "diagnostics"}<button class="button primary" type="button" onclick={save} disabled={saving || !dirty}>{saving ? "Saving..." : "Save changes"}</button>{/if}
|
||||
<button class="button ghost" type="button" onclick={cancel} disabled={saving}>{dirty ? "Cancel" : "Close"}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/key}
|
||||
</section>
|
||||
{/if}
|
||||
</WorkspaceScroll>
|
||||
|
||||
<style>
|
||||
.settings {
|
||||
min-height: 100vh;
|
||||
background: var(--bg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
height: 44px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-2);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: grid; place-items: center;
|
||||
width: 28px; height: 28px;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-3);
|
||||
border-radius: var(--r-sm);
|
||||
cursor: pointer;
|
||||
transition: color 80ms, border-color 80ms;
|
||||
}
|
||||
.back-btn:hover { color: var(--text); border-color: var(--border-2); }
|
||||
|
||||
.settings-header h1 {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.settings-body {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: 160px 1fr;
|
||||
max-width: 640px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.settings-body { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* Tab nav */
|
||||
.tab-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 16px 8px;
|
||||
gap: 2px;
|
||||
border-right: 1px solid var(--border);
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.tab-nav {
|
||||
flex-direction: row;
|
||||
padding: 12px 16px;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.tab {
|
||||
text-align: left;
|
||||
padding: 7px 12px;
|
||||
background: transparent;
|
||||
border: 1px solid transparent;
|
||||
color: var(--text-3);
|
||||
border-radius: var(--r-sm);
|
||||
font-family: var(--sans);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 80ms;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tab:hover { color: var(--text-2); background: var(--bg-2); }
|
||||
.tab.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(20, 184, 166, 0.15); }
|
||||
|
||||
/* Tab content */
|
||||
.tab-content {
|
||||
padding: 24px 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.tab-panel { display: flex; flex-direction: column; gap: 20px; }
|
||||
|
||||
.panel-head { display: flex; flex-direction: column; gap: 2px; }
|
||||
.panel-head h2 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
.panel-desc {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: var(--text-3);
|
||||
}
|
||||
|
||||
.field-list { display: flex; flex-direction: column; gap: 14px; }
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
.field-label {
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--text-3);
|
||||
}
|
||||
|
||||
.field-check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-size: 13px;
|
||||
color: var(--text-2);
|
||||
cursor: pointer;
|
||||
}
|
||||
.field-check input[type="checkbox"] {
|
||||
width: 14px; height: 14px;
|
||||
accent-color: var(--accent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select, .path-input {
|
||||
padding: 8px 10px;
|
||||
background: var(--bg-2);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
border-radius: var(--r-sm);
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
}
|
||||
select:focus, .path-input:focus { border-color: var(--accent); }
|
||||
select { cursor: pointer; font-family: var(--sans); }
|
||||
|
||||
.advanced-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-3);
|
||||
font-size: 12px;
|
||||
font-family: var(--sans);
|
||||
cursor: pointer;
|
||||
padding: 4px 0;
|
||||
transition: color 80ms;
|
||||
width: fit-content;
|
||||
}
|
||||
.advanced-toggle:hover { color: var(--text-2); }
|
||||
.advanced-toggle svg { transition: transform 150ms; }
|
||||
.advanced-toggle svg.rotated { transform: rotate(180deg); }
|
||||
|
||||
.field-note {
|
||||
margin: 0;
|
||||
font-size: 11px;
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.path-row { display: flex; gap: 6px; }
|
||||
.path-input { flex: 1; font-family: var(--mono); font-size: 12px; }
|
||||
|
||||
.panel-foot {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
padding: 9px 22px;
|
||||
background: var(--accent);
|
||||
border: none;
|
||||
color: var(--accent-text);
|
||||
border-radius: var(--r-sm);
|
||||
font-family: var(--sans);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 80ms;
|
||||
}
|
||||
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
|
||||
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
.btn-ghost {
|
||||
padding: 9px 18px;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-2);
|
||||
color: var(--text-3);
|
||||
border-radius: var(--r-sm);
|
||||
font-family: var(--sans);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: border-color 80ms, color 80ms;
|
||||
}
|
||||
.btn-ghost:hover { border-color: var(--border-3); color: var(--text); }
|
||||
|
||||
.warn-block {
|
||||
padding: 14px 16px;
|
||||
background: var(--err-dim);
|
||||
border: 1px solid var(--err-border);
|
||||
border-radius: var(--r-sm);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
.warn-block p { margin: 0; font-size: 12px; color: var(--err); }
|
||||
.warn-actions { display: flex; gap: 8px; }
|
||||
.btn-warn {
|
||||
padding: 8px 16px;
|
||||
background: var(--err);
|
||||
border: none;
|
||||
color: #fff;
|
||||
border-radius: var(--r-sm);
|
||||
font-family: var(--sans);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 80ms;
|
||||
}
|
||||
.btn-warn:hover:not(:disabled) { background: var(--stop-hover); }
|
||||
.btn-warn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
.unsaved-dot {
|
||||
width: 6px; height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--warn);
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* ---- Diagnostics ---- */
|
||||
.diag-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.diag-row .field-label { flex-shrink: 0; width: 90px; }
|
||||
.diag-val { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; word-break: break-all; }
|
||||
.btn-ghost.compact { padding: 5px 12px; font-size: 12px; }
|
||||
.diag-tail-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
|
||||
.diag-tail-head { display: flex; align-items: center; justify-content: space-between; }
|
||||
.diag-tail {
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
background: var(--bg-3);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
line-height: 1.5;
|
||||
color: var(--text-3);
|
||||
max-height: 220px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
.settings-workspace { display:grid; grid-template-columns:minmax(155px,215px) minmax(0,1fr); flex:1; }
|
||||
.settings-nav { display:grid; align-content:start; gap:4px; padding:20px; background:var(--caption); }
|
||||
.settings-nav h3 { margin:4px 12px 12px; }
|
||||
.settings-nav button { justify-content:flex-start; }
|
||||
.settings-nav button[aria-current="true"] { color:var(--ink); background:var(--raised); }
|
||||
.settings-nav button[aria-current="true"] :global(svg) { color:var(--signal); }
|
||||
:global(:root[data-theme="light"]) .settings-nav button[aria-current="true"] :global(svg) { color:#587324; }
|
||||
.settings-pane { min-width:0; max-width:840px; padding:clamp(20px,4vw,44px); }
|
||||
header { margin-bottom:20px; }
|
||||
header .note { margin-top:8px; }
|
||||
.settings-fields { border-radius:var(--radius); background:var(--caption); padding:0 16px; }
|
||||
.setting-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-bottom:var(--edge) solid var(--rule); }
|
||||
.setting-row:last-child { border-bottom:0; }
|
||||
.setting-row > .folder { width:52%; }
|
||||
.setting-row :global(.combo) { width:min(47%,205px); min-width:104px; flex:0 0 auto; }
|
||||
.setting-row .button { white-space:nowrap; flex:0 0 auto; }
|
||||
.setting-row p { margin-top:4px; }
|
||||
.setting-footer { margin-top:20px; }
|
||||
.warnings { margin-top:12px; }
|
||||
.advanced summary { padding-block:12px; }
|
||||
.log-path { overflow-wrap:anywhere; }
|
||||
.log-scroll { position:relative; padding-bottom:12px; }
|
||||
pre { margin:0; max-height:230px; overflow:auto; overflow-wrap:anywhere; white-space:pre-wrap; padding:12px 16px 12px 12px; border-radius:var(--control-radius); background:var(--input); color:var(--copy); }
|
||||
@media(max-width:680px) {
|
||||
.settings-workspace { grid-template-columns:1fr; }
|
||||
.settings-nav { display:flex; flex-wrap:wrap; padding:8px 12px; }
|
||||
.settings-nav h3 { width:100%; }
|
||||
.settings-pane { padding:16px; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user