From 1c6a15704d38ef110743c8ebb613829f7ee43db1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 8 Sep 2025 08:14:24 -0700 Subject: new buttons --- bun.lockb | Bin 66924 -> 68048 bytes package.json | 4 +++- src/lib/Copy.svelte | 15 ++++++++++++++ src/routes/+layout.svelte | 21 ++++++++++--------- src/routes/+page.svelte | 51 +++++++++++++++++++++++++++++++++++----------- tailwind.config.cjs | 25 +++++++++++++++++++++++ 6 files changed, 93 insertions(+), 23 deletions(-) create mode 100644 src/lib/Copy.svelte create mode 100644 tailwind.config.cjs diff --git a/bun.lockb b/bun.lockb index e6ff9ea..1836da6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c933ca2..e31f2fc 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,13 @@ "vite": "^7.0.4" }, "dependencies": { + "@iconify/iconify": "^3.1.1", "@scure/base": "^1.2.6", "@scure/bip32": "^1.7.0", "@scure/bip39": "^1.6.0", "@scure/btc-signer": "^1.8.1", "@sveltejs/adapter-static": "^3.0.8", - "daisyui": "^5.0.46" + "daisyui": "^5.0.46", + "iconify-icon": "^3.0.0" } } diff --git a/src/lib/Copy.svelte b/src/lib/Copy.svelte new file mode 100644 index 0000000..0d8518e --- /dev/null +++ b/src/lib/Copy.svelte @@ -0,0 +1,15 @@ + + +
+ +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ceb238b..f9049c9 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,15 +4,16 @@ let { children } = $props(); -
-
- -
- Bitcoin Wallet -
+
+
+ + - - {@render children()}
+ + {@render children()} +
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index d2d4a97..1654c7b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -7,9 +7,18 @@ import { focus } from '$lib'; import { generateMnemonic, mnemonicToSeedSync } from '@scure/bip39'; import { wordlist } from '@scure/bip39/wordlists/english'; + import Copy from '$lib/Copy.svelte'; + + import 'iconify-icon'; import { getAddress, p2wpkh } from '@scure/btc-signer/payment'; + const pastePassword = async () => { + password = await navigator.clipboard.readText(); + }; + + const toggleReveal = () => (reveal = !reveal); + let NET = 'bitcoin'; const versions = { bitcoin: { @@ -52,6 +61,7 @@ let password = $state(); let mnemonic = $state(); let withdrawing = $state(); + let reveal = $state(false); let balance = $state(); let pending = $state(); @@ -217,23 +227,40 @@
-
- +
+ {#if reveal} + + {:else} + + {/if} - {#if address} -
-
- Address: {address} -
+ - -
- {/if} + + + +
+ +
+ {#if address} +
+
+ Address: {address} +
+ + +
+ {/if} +
{#if loading} diff --git a/tailwind.config.cjs b/tailwind.config.cjs new file mode 100644 index 0000000..8bc2b2d --- /dev/null +++ b/tailwind.config.cjs @@ -0,0 +1,25 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./src/**/*.{html,js,svelte}"], + plugins: [require("daisyui")], + daisyui: { + themes: [ + { + light: { + ...require("daisyui/src/theming/themes").lofi, + gradient: "#C3CFE2", + error: "#b91c1c", + }, + }, + ], // false: only light + dark | true: all themes | array: specific themes like this ["light", "dark", "cupcake"] + darkTheme: "dark", // name of one of the included themes for dark mode + darkMode: 'class', + base: true, // applies background color and foreground color for root element by default + styled: true, // include daisyUI colors and design decisions for all components + utils: true, // adds responsive and modifier utility classes + prefix: "", // prefix for daisyUI classnames (components, modifiers and responsive class names. Not colors) + logs: false, // Shows info about daisyUI version and used config in the console when building your CSS + themeRoot: ":root", // The element that receives theme color CSS variables + }, + safelist: ["w-16", "h-16", "w-20", "h-20", "w-24", "h-24"], +}; -- cgit v1.2.3