config and ffmpeg bootstrap

This commit is contained in:
2026-05-11 23:48:23 +03:00
parent 472aa6f9ec
commit c64ec2045e
15 changed files with 8710 additions and 68 deletions
+125
View File
@@ -0,0 +1,125 @@
<script lang="ts">
import { api, type Config } from "./api"
import { onMount } from "svelte"
let recording: boolean = $state(false)
let config: Config | null = $state(null)
onMount(async () => {
config = await api.getConfig()
})
function toggle() {
recording = !recording
}
</script>
<main>
<header>
<h1>ByteSize</h1>
<p class="sub">ready</p>
</header>
<section class="controls">
<button onclick={toggle} class:active={recording}>
{recording ? "stop" : "start"}
</button>
</section>
{#if config}
<section class="cfg">
<h2>current settings</h2>
<dl>
<dt>format</dt>
<dd>{config.export.default_format}</dd>
<dt>fps</dt>
<dd>{config.capture.default_fps}</dd>
<dt>cursor</dt>
<dd>{config.capture.capture_cursor ? "on" : "off"}</dd>
<dt>audio</dt>
<dd>{config.capture.capture_audio ? "on" : "off"}</dd>
<dt>hotkeys</dt>
<dd>
start: {config.hotkeys.start ?? "-"} |
stop: {config.hotkeys.stop ?? "-"} |
pause: {config.hotkeys.pause ?? "-"}
</dd>
</dl>
</section>
{/if}
<p class="hint">
capture and encode aren't wired up yet. that's next.
</p>
</main>
<style>
main {
padding: 2rem;
max-width: 720px;
margin: 0 auto;
}
header h1 {
margin: 0 0 0.25rem;
font-size: 1.5rem;
letter-spacing: -0.01em;
}
.sub {
color: #888;
font-size: 0.875rem;
margin: 0 0 1.5rem;
}
.controls {
margin: 1rem 0 2rem;
}
button {
font: inherit;
padding: 0.6rem 1.2rem;
border: 1px solid #444;
background: transparent;
color: inherit;
cursor: pointer;
border-radius: 4px;
font-size: 1rem;
}
button:hover {
border-color: #888;
}
button.active {
background: #c33;
border-color: #c33;
color: #fff;
}
.cfg {
border: 1px solid #2a2a2a;
border-radius: 6px;
padding: 1rem 1.25rem;
background: #1e1e1e;
}
.cfg h2 {
margin: 0 0 0.75rem;
font-size: 0.85rem;
color: #888;
font-weight: normal;
text-transform: uppercase;
letter-spacing: 0.05em;
}
dl {
display: grid;
grid-template-columns: 100px 1fr;
gap: 0.5rem 1rem;
margin: 0;
font-size: 0.9rem;
}
dt {
color: #888;
}
dd {
margin: 0;
}
.hint {
color: #888;
font-size: 0.85rem;
margin-top: 2rem;
}
</style>