From 17478a4ac4d409f12c0bec177284a715e64875bf Mon Sep 17 00:00:00 2001 From: nym21 Date: Mon, 22 Jun 2026 16:42:14 +0200 Subject: [PATCH] website: redesign part 34 --- .../src/generators/javascript/client.rs | 9 + modules/brk-client/index.js | 9 + website_next/dialog/style.css | 16 +- website_next/home/index.js | 1 + website_next/home/style.css | 1 - website_next/index.html | 7 +- website_next/styles/main.css | 88 +++++++--- website_next/styles/variables.css | 12 ++ website_next/wallets/add/style.css | 10 -- website_next/wallets/amount/index.js | 2 +- website_next/wallets/amount/style.css | 2 +- website_next/wallets/hold/index.js | 136 +++++++++++++++ website_next/wallets/hold/style.css | 56 ++++++ website_next/wallets/index.js | 26 ++- website_next/wallets/layout/index.js | 19 +- website_next/wallets/layout/style.css | 21 +-- website_next/wallets/lookup/index.js | 41 +++++ website_next/wallets/lookup/local.js | 44 +++++ website_next/wallets/scan/branch.js | 1 + website_next/wallets/scan/branches.js | 1 + website_next/wallets/scan/index.js | 1 + website_next/wallets/selector/index.js | 19 ++ website_next/wallets/selector/style.css | 39 +++-- website_next/wallets/start/index.js | 110 ++---------- website_next/wallets/start/persistent.js | 71 ++++++++ website_next/wallets/start/reset/index.js | 131 +------------- website_next/wallets/start/reset/style.css | 54 ------ website_next/wallets/start/story.js | 40 +++++ website_next/wallets/start/style.css | 31 +--- website_next/wallets/start/temporary.js | 19 ++ website_next/wallets/style.css | 21 +-- website_next/wallets/vault/index.js | 15 ++ website_next/wallets/vault/storage.js | 14 ++ website_next/wallets/wallet/actions/style.css | 19 -- website_next/wallets/wallet/address/index.js | 4 +- website_next/wallets/wallet/address/style.css | 4 +- .../wallets/wallet/addresses/index.js | 64 +++++++ .../wallets/wallet/addresses/style.css | 49 ++++++ .../history.js => history/address.js} | 0 .../wallet/{transactions => history}/cache.js | 4 +- .../wallets/wallet/history/details.js | 38 ++++ website_next/wallets/wallet/history/index.js | 82 +++++++++ website_next/wallets/wallet/history/row.js | 79 +++++++++ .../wallets/wallet/history/section.js | 24 +++ website_next/wallets/wallet/history/style.css | 124 ++++++++++++++ .../{transactions => history}/transaction.js | 0 website_next/wallets/wallet/holdings/cache.js | 109 ++++++++++++ website_next/wallets/wallet/holdings/index.js | 129 ++++++++++++++ .../wallets/wallet/holdings/style.css | 77 +++++++++ website_next/wallets/wallet/holdings/utxo.js | 65 +++++++ website_next/wallets/wallet/index.js | 37 ++-- website_next/wallets/wallet/receive/style.css | 1 - website_next/wallets/wallet/summary/style.css | 20 ++- website_next/wallets/wallet/tabs/index.js | 78 +++++++++ website_next/wallets/wallet/tabs/style.css | 32 ++++ .../wallets/wallet/transactions/index.js | 162 ------------------ .../wallets/wallet/transactions/style.css | 161 ----------------- 57 files changed, 1630 insertions(+), 799 deletions(-) create mode 100644 website_next/wallets/hold/index.js create mode 100644 website_next/wallets/hold/style.css create mode 100644 website_next/wallets/lookup/local.js create mode 100644 website_next/wallets/start/persistent.js create mode 100644 website_next/wallets/start/story.js create mode 100644 website_next/wallets/start/temporary.js delete mode 100644 website_next/wallets/wallet/actions/style.css create mode 100644 website_next/wallets/wallet/addresses/index.js create mode 100644 website_next/wallets/wallet/addresses/style.css rename website_next/wallets/wallet/{transactions/history.js => history/address.js} (100%) rename website_next/wallets/wallet/{transactions => history}/cache.js (93%) create mode 100644 website_next/wallets/wallet/history/details.js create mode 100644 website_next/wallets/wallet/history/index.js create mode 100644 website_next/wallets/wallet/history/row.js create mode 100644 website_next/wallets/wallet/history/section.js create mode 100644 website_next/wallets/wallet/history/style.css rename website_next/wallets/wallet/{transactions => history}/transaction.js (100%) create mode 100644 website_next/wallets/wallet/holdings/cache.js create mode 100644 website_next/wallets/wallet/holdings/index.js create mode 100644 website_next/wallets/wallet/holdings/style.css create mode 100644 website_next/wallets/wallet/holdings/utxo.js create mode 100644 website_next/wallets/wallet/tabs/index.js create mode 100644 website_next/wallets/wallet/tabs/style.css delete mode 100644 website_next/wallets/wallet/transactions/index.js delete mode 100644 website_next/wallets/wallet/transactions/style.css diff --git a/crates/brk_bindgen/src/generators/javascript/client.rs b/crates/brk_bindgen/src/generators/javascript/client.rs index b53de54fa..c0fbf5c72 100644 --- a/crates/brk_bindgen/src/generators/javascript/client.rs +++ b/crates/brk_bindgen/src/generators/javascript/client.rs @@ -51,6 +51,12 @@ const _openBrowserCache = (option) => {{ return caches.open(name).catch(() => null); }}; +/** + * @param {{string}} url + * @returns {{URL}} + */ +const _parseBaseUrl = (url) => new URL(url, typeof location === 'undefined' ? undefined : location.href); + /** * Custom error class for BRK client errors */ @@ -403,6 +409,9 @@ class BrkClientBase {{ const isString = typeof options === 'string'; const rawUrl = isString ? options : options.baseUrl; this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl; + const url = _parseBaseUrl(this.baseUrl); + this.url = url.href.endsWith('/') ? url.href.slice(0, -1) : url.href; + this.domain = url.hostname; this.timeout = isString ? 5000 : (options.timeout ?? 5000); /** @type {{Promise}} */ this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache); diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 9d1da8222..a11fc34c8 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -1497,6 +1497,12 @@ const _openBrowserCache = (option) => { return caches.open(name).catch(() => null); }; +/** + * @param {string} url + * @returns {URL} + */ +const _parseBaseUrl = (url) => new URL(url, typeof location === 'undefined' ? undefined : location.href); + /** * Custom error class for BRK client errors */ @@ -1849,6 +1855,9 @@ class BrkClientBase { const isString = typeof options === 'string'; const rawUrl = isString ? options : options.baseUrl; this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl; + const url = _parseBaseUrl(this.baseUrl); + this.url = url.href.endsWith('/') ? url.href.slice(0, -1) : url.href; + this.domain = url.hostname; this.timeout = isString ? 5000 : (options.timeout ?? 5000); /** @type {Promise} */ this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache); diff --git a/website_next/dialog/style.css b/website_next/dialog/style.css index 20be5fdd4..8b3ce3a02 100644 --- a/website_next/dialog/style.css +++ b/website_next/dialog/style.css @@ -1,6 +1,7 @@ dialog { --dialog-space: 1.5rem; + color-scheme: light; width: min(100% - 2rem, 30rem); border: 0; border-radius: var(--dialog-space); @@ -11,19 +12,4 @@ dialog { &::backdrop { background: color-mix(in oklch, var(--black) 72%, transparent); } - - button { - color: var(--white); - background: var(--gray); - - &:hover { - color: var(--white); - background: var(--black); - } - - &:active { - color: var(--white); - background: var(--orange); - } - } } diff --git a/website_next/home/index.js b/website_next/home/index.js index f097b0696..4b4488ec9 100644 --- a/website_next/home/index.js +++ b/website_next/home/index.js @@ -18,6 +18,7 @@ export function createHomePage() { for (const { href, label } of links) { const link = document.createElement("a"); link.href = href; + link.dataset.button = ""; link.append(label); nav.append(link); } diff --git a/website_next/home/style.css b/website_next/home/style.css index bbee8a776..cdc103d25 100644 --- a/website_next/home/style.css +++ b/website_next/home/style.css @@ -16,6 +16,5 @@ main.home { gap: 0.5rem; font-size: var(--font-size-xs); line-height: 1; - text-transform: uppercase; } } diff --git a/website_next/index.html b/website_next/index.html index 9bddf744e..afe1d59ce 100644 --- a/website_next/index.html +++ b/website_next/index.html @@ -118,18 +118,21 @@ + - + - + + +