diff options
| author | Adam Soltys <[email protected]> | 2025-09-08 08:14:24 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-09-08 08:14:24 -0700 |
| commit | 1c6a15704d38ef110743c8ebb613829f7ee43db1 (patch) | |
| tree | 0ccc053bb1150b15c8f82fd8b34366cfcfdcdec7 /src/lib | |
| parent | 75de7d23fb7557ad7173da4f8bd4697da0cfe42b (diff) | |
| download | coinosv3-1c6a15704d38ef110743c8ebb613829f7ee43db1.tar.gz coinosv3-1c6a15704d38ef110743c8ebb613829f7ee43db1.zip | |
new buttons
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Copy.svelte | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/Copy.svelte b/src/lib/Copy.svelte new file mode 100644 index 0000000..0d8518e --- /dev/null +++ b/src/lib/Copy.svelte @@ -0,0 +1,15 @@ +<script> + let { text = $bindable() } = $props(); + let justCopied = $state(); + const copy = () => { + navigator.clipboard.writeText(text); + justCopied = true; + setTimeout(() => (justCopied = false), 1000); + }; +</script> + +<div data-tip="Copied!" class:tooltip={justCopied}> + <button type="button" class="btn" onclick={copy}> + <iconify-icon icon="ph:copy-bold" width={32} /> + </button> +</div> |
