Skip to content

Commit

Permalink
copy button to get result
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainCodeman committed Jun 18, 2024
1 parent 65fd6b6 commit 9fc9503
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
${groups.leaveTo !== groups.enterFrom ? `leaveTo=${groups.leaveTo}` : ''}
>
</Transition>`) : ''
async function copy() {
await navigator.clipboard.writeText(result)
}
</script>

<main class="m-4">
Expand All @@ -52,5 +56,13 @@
<pre class="rounded-md border px-4 py-1.5 text-gray-900 font-mono text-sm leading-5 bg-gray-50">{result}</pre>
</div>
</div>

<button type="button" class="mt-2 flex items-center gap-1 rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50" on:click={copy}>
<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-gray-500 size-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z" />
</svg>
Copy
</button>

{/if}
</main>
</main>

0 comments on commit 9fc9503

Please sign in to comment.