From 7490ee399b8fe9442dfc18b5e0788fa32e2c77e4 Mon Sep 17 00:00:00 2001 From: Talentedunicorn Date: Fri, 3 Jan 2025 22:10:33 +0800 Subject: [PATCH] Added routes --- About.md | 5 + package.json | 1 + pnpm-lock.yaml | 16 +++ src/App.svelte | 227 +++++++++++++++++-------------------- src/List.svelte | 3 - src/app.css | 4 + src/auth.ts | 3 +- src/components/Form.svelte | 10 +- src/db.ts | 23 +++- src/routes/About.svelte | 56 +++++++++ src/routes/Home.svelte | 64 +++++++++++ src/routes/Login.svelte | 29 +++++ src/routes/NotFound.svelte | 13 +++ 13 files changed, 316 insertions(+), 138 deletions(-) create mode 100644 About.md create mode 100644 src/routes/About.svelte create mode 100644 src/routes/Home.svelte create mode 100644 src/routes/Login.svelte create mode 100644 src/routes/NotFound.svelte diff --git a/About.md b/About.md new file mode 100644 index 0000000..390e3f3 --- /dev/null +++ b/About.md @@ -0,0 +1,5 @@ +# About ToDone + +An offline-first note-taking app that gets you from _To Do_ to **Done** + +Made by [Talentedunicorn](https://talentedunicorn.com) with 🫰 and [Svelte](https://svelte.dev) diff --git a/package.json b/package.json index 1a3b3be..d28a188 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "marked": "^15.0.6", "rxdb": "^15.39.0", "rxjs": "^7.8.1", + "svelte-spa-router": "^4.0.1", "vite-plugin-pwa": "^0.21.1", "zod": "^3.24.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92bdd7c..fa4eddb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: rxjs: specifier: ^7.8.1 version: 7.8.1 + svelte-spa-router: + specifier: ^4.0.1 + version: 4.0.1 vite-plugin-pwa: specifier: ^0.21.1 version: 0.21.1(vite@6.0.7(@types/node@22.10.5)(terser@5.37.0)(yaml@2.7.0))(workbox-build@7.1.1(@types/babel__core@7.20.5))(workbox-window@7.3.0) @@ -4932,6 +4935,10 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} + regexparam@2.0.2: + resolution: {integrity: sha512-A1PeDEYMrkLrfyOwv2jwihXbo9qxdGD3atBYQA9JJgreAx8/7rC6IUkWOw2NQlOxLp2wL0ifQbh1HuidDfYA6w==} + engines: {node: '>=8'} + regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} @@ -5360,6 +5367,9 @@ packages: typescript: optional: true + svelte-spa-router@4.0.1: + resolution: {integrity: sha512-2JkmUQ2f9jRluijL58LtdQBIpynSbem2eBGp4zXdi7aDY1znbR6yjw0KsonD0aq2QLwf4Yx4tBJQjxIjgjXHKg==} + svelte2tsx@0.7.34: resolution: {integrity: sha512-WTMhpNhFf8/h3SMtR5dkdSy2qfveomkhYei/QW9gSPccb0/b82tjHvLop6vT303ZkGswU/da1s6XvrLgthQPCw==} peerDependencies: @@ -11809,6 +11819,8 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 + regexparam@2.0.2: {} + regexpp@3.2.0: {} regexpu-core@6.2.0: @@ -12333,6 +12345,10 @@ snapshots: postcss: 8.4.49 typescript: 5.7.3 + svelte-spa-router@4.0.1: + dependencies: + regexparam: 2.0.2 + svelte2tsx@0.7.34(svelte@5.17.3)(typescript@5.7.3): dependencies: dedent-js: 1.0.1 diff --git a/src/App.svelte b/src/App.svelte index 259ee5d..45a082a 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,37 +1,30 @@ @@ -70,33 +100,12 @@
- {#if import.meta.env.VITE_SYNCED === 'true' && !$isLoggedin} - - {:else} - -
-

- - -
-
- {#if $isLoggedin} -
- {$user.nickname} - -
- {/if} - -
- {/if} +
+

+ + +
+ {#if showBackToTop}