From: Chris Duncan Date: Sun, 27 Oct 2024 05:09:59 +0000 (-0700) Subject: Rename some variables and functions for clarity of usage. Convert dialogs to forms... X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=d67d03013955efe77521d7df8b65dff65e3dce86;p=nemo-wallet.git Rename some variables and functions for clarity of usage. Convert dialogs to forms and start converting them to full content pages that display on top of other main pages so that URL hash doesn't need to change when creating wallets and accounts. --- diff --git a/app/pages/nemo-wallet.html b/app/pages/nemo-wallet.html index 3ce1d32..e4e0e3d 100644 --- a/app/pages/nemo-wallet.html +++ b/app/pages/nemo-wallet.html @@ -51,12 +51,12 @@ async function loadUi () { console.log('loading ui') - const dialogs = document.querySelectorAll('dialog') - for (const dialog of dialogs) { - const cancelButtons = dialog.querySelectorAll('button.cancel') + const forms = document.querySelectorAll('form') + for (const form of forms) { + const cancelButtons = form.querySelectorAll('button.cancel') for (const cancelButton of cancelButtons) { cancelButton.addEventListener('click', (event) => { - cancelDialog(dialog.id) + cancelForm(form.parentElement.id) }) } } @@ -72,10 +72,9 @@ console.log('loaded ui') } - function switchPage (evt) { - console.log(evt) - const oldHash = new URL(evt.oldURL)?.hash - const newHash = new URL(evt.newURL)?.hash + function switchPage (event) { + const oldHash = new URL(event.oldURL)?.hash + const newHash = new URL(event.newURL)?.hash if (oldHash) { document.querySelector(oldHash)?.classList.remove('show') } @@ -163,7 +162,7 @@ } case '_new': { try { - await document.getElementById('wallet-new').showModal() + document.getElementById('wallet-new').classList.add('show') } catch (err) { walletSelect.value = '' console.error(err) @@ -174,7 +173,7 @@ } case '_import': { try { - await document.getElementById('wallet-import').showModal() + document.getElementById('wallet-import').classList.add('show') } catch (err) { walletSelect.value = '' console.error(err) @@ -302,7 +301,7 @@ switch (accountSelect.value) { case '_new': { try { - return await document.getElementById('account-new').showModal() + document.getElementById('account-new').classList.add('show') } catch (err) { accountSelect.value = '' console.error(err) @@ -410,9 +409,9 @@ } } - async function cancelDialog (id) { + async function cancelForm (id) { await resetDialogInputs() - await document.getElementById(id).close() + await document.getElementById(id).classList.remove('show') } async function resetDialogInputs () { @@ -461,15 +460,29 @@ body { background-color: var(--color-dark); color: var(--color-light); + display: flex; fill: var(--color-blue); font-family: var(--text-body); - font-size: 16px; /* required to prevent zoom on input focus on mobile */ - height: 100vh; - margin: 0; + font-size: 16px !important; /* prevents input focus zoom on mobile */ + height: 100vh !important; + margin: 0 !important; + min-height: 100vh !important; + max-height: 100vh !important; + } + header { + padding: 0.5rem; } main { height: 100%; } + nav { + align-items: flex-end; + bottom: 0; + display: flex; + justify-content: space-evenly; + position: absolute; + width: 100%; + } h1, h2, h3, h4, h5, h6 { font-family: var(--text-heading); } @@ -610,9 +623,6 @@ grid-column-start: auto; grid-column-end: span 12; } - header { - padding: 0.5rem; - } hr { margin: revert !important; } @@ -650,6 +660,9 @@ .page.show { display: initial; } + .page.form { + z-index: 10; + } .hide { display: none; } @@ -671,14 +684,6 @@ :required:invalid { border: 1px solid red; } - nav { - align-items: flex-end; - bottom: 0; - display: flex; - justify-content: space-evenly; - position: absolute; - width: 100%; - } nav > a { border: 0; display: flex; @@ -725,95 +730,6 @@ - - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
- - - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
-
@@ -825,39 +741,135 @@
+ - + - -
-
- - -
-
- - -
-
- - +
+ + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
-
-
- - + +
+ + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
-
-
- + + - + -
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+