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
+137
View File
@@ -0,0 +1,137 @@
<script lang="ts">
import { api } from "./api"
let { onDone }: { onDone: () => void } = $props()
let start = $state("")
let stop = $state("")
let pause = $state("")
let saving = $state(false)
async function save() {
saving = true
try {
const cfg = await api.getConfig()
cfg.hotkeys.start = start.trim() || null
cfg.hotkeys.stop = stop.trim() || null
cfg.hotkeys.pause = pause.trim() || null
await api.saveConfig(cfg)
onDone()
} finally {
saving = false
}
}
let valid = $derived(start.trim() && stop.trim() && pause.trim())
</script>
<main>
<header>
<h1>ByteSize</h1>
<p class="sub">assign your hotkeys</p>
</header>
<p>
ByteSize doesn't ship default hotkeys. Pick combinations that won't clash
with apps you use. You can change these later in settings.
</p>
<div class="form">
<label>
<span>start</span>
<input bind:value={start} placeholder="e.g. F9" />
</label>
<label>
<span>stop</span>
<input bind:value={stop} placeholder="e.g. F9" />
</label>
<label>
<span>pause</span>
<input bind:value={pause} placeholder="e.g. F10" />
</label>
</div>
<div class="row">
<button class="primary" disabled={!valid || saving} onclick={save}>
{saving ? "saving..." : "save and continue"}
</button>
</div>
<p class="hint">
Live key capture isn't wired up yet - for now type the combination as text
(F9, Ctrl+Shift+R, etc).
</p>
</main>
<style>
main {
padding: 2rem;
max-width: 560px;
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;
}
.form {
display: grid;
gap: 0.75rem;
margin: 1.25rem 0;
}
label {
display: grid;
grid-template-columns: 80px 1fr;
align-items: center;
gap: 0.75rem;
}
label span {
color: #aaa;
font-size: 0.875rem;
}
input {
font: inherit;
padding: 0.45rem 0.6rem;
border: 1px solid #444;
background: #222;
color: inherit;
border-radius: 4px;
}
input:focus {
outline: none;
border-color: #4a8;
}
.row {
display: flex;
gap: 0.5rem;
margin: 1rem 0;
}
.hint {
color: #888;
font-size: 0.85rem;
}
button {
font: inherit;
padding: 0.5rem 1rem;
border: 1px solid #444;
background: transparent;
color: inherit;
cursor: pointer;
border-radius: 4px;
}
button:hover:not(:disabled) {
border-color: #888;
}
button.primary {
background: #4a8;
border-color: #4a8;
color: #111;
}
button.primary:disabled {
background: #333;
border-color: #333;
color: #666;
cursor: not-allowed;
}
</style>