diff options
| author | Adam Soltys <[email protected]> | 2025-03-12 11:43:57 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-03-12 11:43:57 -0700 |
| commit | 6ab15eb64fe0187beee380868882dd8f9c8aa587 (patch) | |
| tree | 5efe69db3498fce1b97ba7deee6412278395b62d /src | |
| parent | f699c0739d09feb8960b2f5255e9998843682f6f (diff) | |
| download | coinos-ui-6ab15eb64fe0187beee380868882dd8f9c8aa587.tar.gz coinos-ui-6ab15eb64fe0187beee380868882dd8f9c8aa587.zip | |
copy peanut
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> |
