aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/stores/ui.svelte.ts
diff options
context:
space:
mode:
authorNatsuu <natsukawa247@outlook.com>2026-01-14 03:41:18 +0000
committerNatsuu <natsukawa247@outlook.com>2026-01-14 03:41:18 +0000
commit64b939e6ac0b196d18ee183a37a40b0bf7927a80 (patch)
tree54b366819e9f3fd8694092c0053dd5e706da59f9 /ui/src/stores/ui.svelte.ts
parent8aeadd2c2203540b93eabc6ba53b7b4ceaff7eb7 (diff)
downloadDropOut-64b939e6ac0b196d18ee183a37a40b0bf7927a80.tar.gz
DropOut-64b939e6ac0b196d18ee183a37a40b0bf7927a80.zip
refactor: split App.svelte into components
Diffstat (limited to 'ui/src/stores/ui.svelte.ts')
-rw-r--r--ui/src/stores/ui.svelte.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/ui/src/stores/ui.svelte.ts b/ui/src/stores/ui.svelte.ts
new file mode 100644
index 0000000..8fc339b
--- /dev/null
+++ b/ui/src/stores/ui.svelte.ts
@@ -0,0 +1,34 @@
+export class UIState {
+ currentView = $state("home");
+ status = $state("Ready");
+ showConsole = $state(false);
+ appVersion = $state("...");
+
+ private statusTimeout: any;
+
+ constructor() {
+ // Watch for status changes to auto-dismiss
+ $effect(() => {
+ if (this.status !== "Ready") {
+ if (this.statusTimeout) clearTimeout(this.statusTimeout);
+ this.statusTimeout = setTimeout(() => {
+ this.status = "Ready";
+ }, 5000);
+ }
+ });
+ }
+
+ setStatus(msg: string) {
+ this.status = msg;
+ }
+
+ toggleConsole() {
+ this.showConsole = !this.showConsole;
+ }
+
+ setView(view: string) {
+ this.currentView = view;
+ }
+}
+
+export const uiState = new UIState();