mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-20 15:38:11 -07:00
website_next: part 2
This commit is contained in:
@@ -128,10 +128,11 @@ export function getBtcParts(sats, options = {}) {
|
||||
* @param {BtcAmountOptions} [options]
|
||||
*/
|
||||
export function renderBtcAmount(element, sats, options = {}) {
|
||||
element.dataset.btcAmount = "";
|
||||
element.replaceChildren(...getBtcParts(sats, options).map((part) => {
|
||||
const span = document.createElement("span");
|
||||
|
||||
if (part.muted) span.classList.add("muted");
|
||||
if (part.muted) span.dataset.btcMuted = "";
|
||||
span.append(part.text);
|
||||
|
||||
return span;
|
||||
@@ -147,7 +148,6 @@ export function renderBtcAmount(element, sats, options = {}) {
|
||||
export function createBtcAmount(tag, sats, options = {}) {
|
||||
const element = document.createElement(tag);
|
||||
|
||||
element.classList.add("amount");
|
||||
renderBtcAmount(element, sats, options);
|
||||
|
||||
return element;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.amount {
|
||||
.muted {
|
||||
[data-btc-amount] {
|
||||
[data-btc-muted] {
|
||||
color: color-mix(in oklch, currentColor 45%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user