diff --git a/src/lib/components/Offline.svelte b/src/lib/components/Offline.svelte
new file mode 100644
index 0000000..0a8a00e
--- /dev/null
+++ b/src/lib/components/Offline.svelte
@@ -0,0 +1,72 @@
+
+
+
+
YOU ARE OFFLINE
+
+
Please check your internet connection.
+
+ An internet connection is required to sync your wallet and make
+ transactions.
+
+
+
+
diff --git a/src/lib/components/PasswordDialog.svelte b/src/lib/components/PasswordDialog.svelte
index c69e063..95694a3 100644
--- a/src/lib/components/PasswordDialog.svelte
+++ b/src/lib/components/PasswordDialog.svelte
@@ -6,7 +6,8 @@
openWallet,
} from "$lib/wallet.svelte";
import { browser } from "$app/environment";
- import { onMount } from "svelte";
+ import { onMount, tick } from "svelte";
+ import { fly } from "svelte/transition";
let { onunlock }: { onunlock: () => void } = $props();
@@ -14,8 +15,11 @@
let password = $state("");
let error = $state("");
let isValidating = $state(false);
+ let show = $state(false);
- onMount(() => {
+ onMount(async () => {
+ show = true;
+ await tick();
dialogEl?.showModal();
});
@@ -41,45 +45,50 @@
}
-
+ onkeydown={(e) => {
+ if (e.key === "Enter" && !isValidating) {
+ attemptUnlock();
+ }
+ }}
+ />
+
+
+
+
+{/if}
diff --git a/src/lib/components/ToggleSwitch.svelte b/src/lib/components/ToggleSwitch.svelte
new file mode 100644
index 0000000..9d3aa97
--- /dev/null
+++ b/src/lib/components/ToggleSwitch.svelte
@@ -0,0 +1,88 @@
+
+
+
+
+
diff --git a/src/lib/online.svelte.ts b/src/lib/online.svelte.ts
new file mode 100644
index 0000000..cf71c57
--- /dev/null
+++ b/src/lib/online.svelte.ts
@@ -0,0 +1,24 @@
+import { writable } from "svelte/store";
+
+function createOnline() {
+ const { subscribe, set } = writable(navigator.onLine);
+
+ function handleOnline() {
+ set(true);
+ }
+
+ function handleOffline() {
+ set(false);
+ }
+
+ if (typeof window !== "undefined") {
+ window.addEventListener("online", handleOnline);
+ window.addEventListener("offline", handleOffline);
+ }
+
+ return {
+ subscribe,
+ };
+}
+
+export const online = createOnline();
diff --git a/src/lib/settings.svelte.ts b/src/lib/settings.svelte.ts
new file mode 100644
index 0000000..8b99cf0
--- /dev/null
+++ b/src/lib/settings.svelte.ts
@@ -0,0 +1,28 @@
+import { persistentDbWritable } from "$lib/index";
+import type { Writable } from "svelte/store";
+import Dexie, { type Table } from "dexie";
+
+interface MetaEntry {
+ key: string;
+ value: string;
+}
+
+class SettingsDB extends Dexie {
+ meta!: Table;
+
+ constructor() {
+ super("settings");
+ this.version(1).stores({
+ meta: "&key"
+ });
+ }
+}
+
+const settingsDB = new SettingsDB();
+
+export const shaderEnabled: Writable = persistentDbWritable(
+ "shaderEnabled",
+ true,
+
+ settingsDB
+);
diff --git a/src/lib/style.css b/src/lib/style.css
index 77fa773..09531f2 100644
--- a/src/lib/style.css
+++ b/src/lib/style.css
@@ -31,8 +31,7 @@ body {
letter-spacing: 0.5px;
line-height: 1.2;
text-shadow: 1px 1px 0 #000;
- overflow-x: hidden;
- overflow-y: auto;
+ overflow: hidden;
}
.app-wrapper {
@@ -44,14 +43,6 @@ body {
padding: 2rem 1rem 4rem;
}
-.container {
- width: 100%;
- max-width: 28rem;
- display: flex;
- flex-direction: column;
- align-items: stretch;
-}
-
.send-receive-buttons {
display: flex;
gap: 0.75rem;
@@ -68,6 +59,9 @@ body {
box-shadow:
0 0 0 4px #000,
0 0 0 8px var(--primary-color);
+ .header {
+ cursor: pointer;
+ }
}
.retro-card::before {
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 74c55c3..7b59dbe 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -10,6 +10,9 @@
import SplashScreen from "$lib/components/SplashScreen.svelte";
import ErrorDialog from "$lib/components/ErrorDialog.svelte";
import InstallPrompt from "$lib/components/InstallPrompt.svelte";
+ import { online } from "$lib/online.svelte";
+ import Offline from "$lib/components/Offline.svelte";
+ import { shaderEnabled } from "$lib/settings.svelte";
type AppError = {
message: string;
@@ -18,6 +21,7 @@
let { children } = $props();
let showSplash = $state(true);
+ let closingSplash = $state(false);
let currentError = $state(null);
let showInstallPrompt = $state(false);
let deferredPrompt: Event | undefined = $state(undefined);
@@ -45,7 +49,10 @@
onMount(() => {
setTimeout(() => {
- showSplash = false;
+ closingSplash = true;
+ setTimeout(() => {
+ showSplash = false;
+ }, 1000);
}, 3000);
window.addEventListener("error", (event: ErrorEvent) => {
@@ -89,34 +96,82 @@
Portal BTC
-{#if showInstallPrompt && deferredPrompt}
-
-{:else if showSplash}
-
-{:else}
-
- {#if showSettingsButton}
-
-
-
- {/if}
-
- {#if isOnSetup || $walletState.open}
- {@render children()}
- {/if}
-
-
- {#if !$walletState.open && !isOnSetup}
+
+ {#if !$online}
+
+ {:else if showInstallPrompt && deferredPrompt}
+
+ {:else if showSplash}
+
+ {:else if !$walletState.open && !isOnSetup}
startNwc()} />
- {/if}
-{/if}
+ {:else}
+
+ {#if showSettingsButton}
+
+
+
+ {/if}
- (currentError = null)} />
+ {@render children()}
+
+ {/if}
+
+ (currentError = null)} />
+
+
+
+
+
+
+
+
diff --git a/static/logo-no-text.png b/static/logo-no-text.png
new file mode 100644
index 0000000..e2a5d9e
Binary files /dev/null and b/static/logo-no-text.png differ