From 601a861b268520266125e10d6b4718fae1d2995d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 17 Oct 2024 01:54:46 -0700 Subject: [PATCH] Add page switching from nav bar. Start switching to bootstrap icons. Refactor CSS. Start replacing some xel elements. Embed Nano X symbol directly in nav bar as a button. --- app/pages/nemo-wallet.html | 219 ++++++++++++++++++++++++------------- 1 file changed, 140 insertions(+), 79 deletions(-) diff --git a/app/pages/nemo-wallet.html b/app/pages/nemo-wallet.html index 3cca50c..9b79157 100644 --- a/app/pages/nemo-wallet.html +++ b/app/pages/nemo-wallet.html @@ -32,6 +32,23 @@ async function loadUx () { const notification = document.getElementById('notification') observer.observe(notification, { attributes: true }) + if (location.hash) { + const page = document.querySelector(location.hash) + page.classList.add('show') + } else { + location += '#transact' + } + } + function switchPage (evt) { + console.log(evt) + const oldHash = new URL(evt.oldURL)?.hash + const newHash = new URL(evt.newURL)?.hash + if (oldHash) { + document.querySelector(oldHash).classList.remove('show') + } + if (newHash) { + document.querySelector(newHash).classList.add('show') + } } function getWalletType (type) { switch (type) { @@ -44,12 +61,12 @@ } } } - async function createWallet (el, type) { - const label = el.firstElementChild + async function createWallet (elm, type) { + const label = elm.firstElementChild const spinner = document.createElement('x-throbber') spinner.size = 'small' spinner.style.width = `${label.scrollWidth}px` - el.replaceChildren(spinner) + elm.replaceChildren(spinner) const walletType = getWalletType(type) let wallet try { @@ -62,7 +79,7 @@ } catch (err) { notify.error(err.msg) } finally { - el.replaceChildren(label) + elm.replaceChildren(label) return wallet } } @@ -134,93 +151,137 @@ error: (msg) => notify.show(`🚫 ${msg}`, 'Tomato') } - - - + + + + - +
- - - Wallets - - - - New - - - Type - BIP-44 - BLAKE2b - - Password - - - - - - - Import - - - - - - + + + + + New Wallet + + Name + + Type + BIP-44 + BLAKE2b + + Password + + + + + + Import Wallet + + + +
+
+
+ + + + New + +
+
+
- - - - Clear Storage - + + Exchange + + + History + + + Transact + + + + + Rolodex + + +

Settings

+ + Clear Storage + +
-- 2.34.1