{output.address.slice(0,-6)}{output.address.slice(-6)}
{ output.value == null ? '???' : formatBTC(output.value) }
diff --git a/client/public/global.css b/client/public/global.css index 936fd9a..ecceba9 100644 --- a/client/public/global.css +++ b/client/public/global.css @@ -48,6 +48,8 @@ --twitter-blue: #1da1f2; --monospace-purple: darkviolet; + + --loading-color: var(--palette-x); } .light-mode { diff --git a/client/src/components/SearchBar.svelte b/client/src/components/SearchBar.svelte index 62acf43..3c9b541 100644 --- a/client/src/components/SearchBar.svelte +++ b/client/src/components/SearchBar.svelte @@ -9,7 +9,7 @@ import AddressIcon from '../assets/icon/cil-wallet.svg' import TxIcon from '../assets/icon/cil-arrow-circle-right.svg' import { fly } from 'svelte/transition' import { matchQuery, searchTx, searchBlock } from '../utils/search.js' -import { selectedTx, detailTx, overlay } from '../stores.js' +import { selectedTx, detailTx, overlay, loading } from '../stores.js' let query let matchedQuery @@ -26,19 +26,21 @@ async function searchSubmit (e) { e.preventDefault() if (matchedQuery) { + $loading++ switch(matchedQuery.query) { case 'txid': - searchTx(matchedQuery.txid) + await searchTx(matchedQuery.txid) break; case 'input': - searchTx(matchedQuery.txid, matchedQuery.input, null) + await searchTx(matchedQuery.txid, matchedQuery.input, null) break; case 'output': - searchTx(matchedQuery.txid, null, matchedQuery.output) + await searchTx(matchedQuery.txid, null, matchedQuery.output) break; } + $loading-- } return false diff --git a/client/src/components/TransactionOverlay.svelte b/client/src/components/TransactionOverlay.svelte index 735cb29..fef72c0 100644 --- a/client/src/components/TransactionOverlay.svelte +++ b/client/src/components/TransactionOverlay.svelte @@ -3,7 +3,7 @@ import Overlay from '../components/Overlay.svelte' import Icon from './Icon.svelte' import BookmarkIcon from '../assets/icon/cil-bookmark.svg' import { longBtcFormat, numberFormat, feeRateFormat, dateFormat } from '../utils/format.js' -import { exchangeRates, settings, sidebarToggle, newHighlightQuery, highlightingFull, detailTx, pageWidth, latestBlockHeight, highlightInOut } from '../stores.js' +import { exchangeRates, settings, sidebarToggle, newHighlightQuery, highlightingFull, detailTx, pageWidth, latestBlockHeight, highlightInOut, loading } from '../stores.js' import { formatCurrency } from '../utils/fx.js' import { hlToHex, mixColor, teal, purple } from '../utils/color.js' import { SPKToAddress } from '../utils/encodings.js' @@ -249,11 +249,17 @@ function getMiterOffset (weight, dy, dx) { } else return 0 } -function clickItem (item) { +async function clickItem (item) { if (item.rest) { truncate = false } else if (item.prev_txid && item.prev_vout != null) { - searchTx(item.prev_txid, null, item.prev_vout) + $loading++ + await searchTx(item.prev_txid, null, item.prev_vout) + $loading-- + } else if (item.spend && item.spend.txid && item.spend.vin) { + $loading++ + await searchTx(item.spend.txid, item.spend.vin) + $loading-- } } @@ -265,8 +271,14 @@ function clickItem (item) { text-align: left; h2 { + margin: 0 0 1em; font-size: 1.2em; word-break: break-word; + + .title { + font-size: 1.25em; + white-space: nowrap; + } } .tx-id { @@ -277,7 +289,7 @@ function clickItem (item) { .icon-button { float: right; - font-size: 24px; + font-size: 1.1em; margin: 0; transition: opacity 300ms, color 300ms, background 300ms; background: var(--palette-d); @@ -299,7 +311,7 @@ function clickItem (item) { padding: 4px 8px; border-radius: 8px; float: right; - margin: 5px; + margin: 0 5px; color: white; font-weight: bold; @@ -413,7 +425,7 @@ function clickItem (item) { &.highlight { background: linear-gradient(90deg, var(--bold-a) -100%, transparent 100%); } - &:hover { + &.clickable:hover { background: linear-gradient(90deg, var(--palette-e), transparent); } .address { @@ -425,10 +437,14 @@ function clickItem (item) { &.outputs { .entry { padding-right: 10px; + border-right: solid 1px transparent; + &.unspent { + border-right: solid 1px var(--grey); + } &.highlight { background: linear-gradient(90deg, transparent 0%, var(--bold-a) 200%); } - &:hover { + &.clickable:hover { background: linear-gradient(-90deg, var(--palette-e), transparent); } } @@ -486,7 +502,7 @@ function clickItem (item) { unconfirmed {/if} -
{$detailTx.outputs.length} output{$detailTx.outputs.length > 1 ? 's' : ''} {#if $detailTx.fee != null}+ fee{/if}
{#each outputs as output} -{output.address.slice(0,-6)}{output.address.slice(-6)}
{ output.value == null ? '???' : formatBTC(output.value) }