From 6785ead4527ff5d529d1f5e32674ef912a68d323 Mon Sep 17 00:00:00 2001 From: marcobaobao Date: Wed, 7 Feb 2024 14:40:27 +0100 Subject: [PATCH] code refactoring --- ui/src/App.svelte | 50 ++++-------------------- ui/src/app.css | 82 +++------------------------------------ ui/src/lib/Counter.svelte | 10 ----- ui/src/lib/store.ts | 4 +- 4 files changed, 15 insertions(+), 131 deletions(-) delete mode 100644 ui/src/lib/Counter.svelte diff --git a/ui/src/App.svelte b/ui/src/App.svelte index e8b590f..a8f8197 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -1,47 +1,13 @@
-
- - - - - - -
-

Vite + Svelte

- -
- -
- -

- Check out SvelteKit, the official Svelte app framework powered by Vite! -

- -

- Click on the Vite and Svelte logos to learn more -

+ {$serverApiEndpoint} + {$httpPostRpcEndpoint} + {$websocketRpcEndpoint}
- - diff --git a/ui/src/app.css b/ui/src/app.css index 617f5e9..0251515 100644 --- a/ui/src/app.css +++ b/ui/src/app.css @@ -1,79 +1,7 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -.card { - padding: 2em; -} - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} +} \ No newline at end of file diff --git a/ui/src/lib/Counter.svelte b/ui/src/lib/Counter.svelte deleted file mode 100644 index 979b4df..0000000 --- a/ui/src/lib/Counter.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/ui/src/lib/store.ts b/ui/src/lib/store.ts index f12f2e3..5e24744 100644 --- a/ui/src/lib/store.ts +++ b/ui/src/lib/store.ts @@ -1,9 +1,9 @@ import { derived, readable, writable } from 'svelte/store' -import { RPCClient } from './RpcClient' +import { RPCClient } from './RPCClient' import type { RPCResponse, RPCResult } from './types' export const rpcHost = writable(localStorage.getItem('rpcHost') ?? 'localhost') -export const rpcPort = writable(Number(localStorage.getItem('rpcPort')) ?? 3033) +export const rpcPort = writable(Number(localStorage.getItem('rpcPort')) || 3033) export const rpcWebToken = writable(localStorage.getItem('rpcWebToken') ?? '')