current state before improvement pass
This commit is contained in:
+31
-13
@@ -17,11 +17,16 @@
|
||||
let status: AppStatus
|
||||
try {
|
||||
status = await api.getStatus()
|
||||
} catch (e) {
|
||||
console.error("get_status failed", e)
|
||||
} catch {
|
||||
view = "bootstrap"
|
||||
return
|
||||
}
|
||||
try {
|
||||
const cfg = await api.getConfig()
|
||||
document.documentElement.setAttribute("data-theme", cfg.theme)
|
||||
} catch {
|
||||
document.documentElement.setAttribute("data-theme", "dark")
|
||||
}
|
||||
if (status.ffmpeg === "missing") view = "bootstrap"
|
||||
else if (status.needs_first_run) view = "first-run"
|
||||
else view = "main"
|
||||
@@ -32,14 +37,27 @@
|
||||
|
||||
<UpdateBanner />
|
||||
|
||||
{#if view === "loading"}
|
||||
<Loading />
|
||||
{:else if view === "bootstrap"}
|
||||
<Bootstrap onReady={refresh} />
|
||||
{:else if view === "first-run"}
|
||||
<FirstRun onDone={refresh} />
|
||||
{:else if view === "settings"}
|
||||
<Settings onClose={() => view = "main"} />
|
||||
{:else}
|
||||
<Main onSettings={() => view = "settings"} />
|
||||
{/if}
|
||||
<div class="view-stage" class:shift={view !== "loading"}>
|
||||
{#if view === "loading"}
|
||||
<Loading />
|
||||
{:else if view === "bootstrap"}
|
||||
<Bootstrap onReady={refresh} />
|
||||
{:else if view === "first-run"}
|
||||
<FirstRun onDone={refresh} />
|
||||
{:else if view === "settings"}
|
||||
<Settings onClose={() => view = "main"} />
|
||||
{:else}
|
||||
<Main onSettings={() => view = "settings"} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.view-stage {
|
||||
min-height: 100vh;
|
||||
animation: enter 180ms ease-out;
|
||||
}
|
||||
@keyframes enter {
|
||||
from { opacity: 0; transform: translateY(4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user