diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(app)/ecash/[id]/[...version]/+page.svelte | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/routes/(app)/ecash/[id]/[...version]/+page.svelte b/src/routes/(app)/ecash/[id]/[...version]/+page.svelte index b98e6bfa..e1a38235 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/+page.svelte +++ b/src/routes/(app)/ecash/[id]/[...version]/+page.svelte @@ -8,6 +8,24 @@ let link = $page.url.href; let { id, total, token, external, spent } = $state(data); + + let peanut = $derived( + "🥜" + + Array.from(token) + .map((char) => { + const byteValue = char.charCodeAt(0); + // For byte values 0-15, use Variation Selectors (VS1-VS16): U+FE00 to U+FE0F + if (byteValue >= 0 && byteValue <= 15) { + return String.fromCodePoint(0xfe00 + byteValue); + } + + // For byte values 16-255, use Variation Selectors Supplement (VS17-VS256): U+E0100 to U+E01EF + if (byteValue >= 16 && byteValue <= 255) { + return String.fromCodePoint(0xe0100 + (byteValue - 16)); + } + }) + .join(""), + ); </script> {#if form?.error} @@ -24,15 +42,21 @@ <div class="my-auto">{$t("payments.shareLink")}</div> </button> + <button type="button" class="btn" onclick={() => copy(peanut)}> + <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon> + <div class="my-auto">Copy {peanut} emoji</div> + </button> + {#if spent < total} {#if external} <a href={`/ecash/${id}/swap`} class="contents"> <button type="submit" class="btn"> - <iconify-icon noobserver + <iconify-icon + noobserver icon="ph:hand-coins-bold" width="32" flip="horizontal" -></iconify-icon> + ></iconify-icon> <div class="my-auto">{$t("payments.swap")}</div> </button> </a> @@ -40,11 +64,12 @@ <form method="POST" use:enhance class="w-full"> <input type="hidden" name="token" bind:value={token} /> <button type="submit" class="btn"> - <iconify-icon noobserver + <iconify-icon + noobserver icon="ph:hand-coins-bold" width="32" flip="horizontal" -></iconify-icon> + ></iconify-icon> <div class="my-auto">{$t("payments.redeem")}</div> </button> </form> |
