download button for sharex button result

This commit is contained in:
cirroskais 2024-08-02 11:36:47 -04:00
parent e130fcd4c3
commit a927530fe5
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D
2 changed files with 8 additions and 1 deletions

View file

@ -1,15 +1,17 @@
<script>
export let href,
download,
style = 'link';
</script>
{#if style === 'link'}
<a {href} class="text-blue-500">
<a {href} {download} class="text-blue-500">
<slot />
</a>
{:else if style === 'button'}
<a
{href}
{download}
class="flex p-2 space-x-2 rounded-lg border-b-2 hadow-md bg-crust border-overlay2 hover:border-overlay0 group-disabled/button:border-overlay0 group-disabled/button:hover:border-overlay0"
>
<slot />

View file

@ -1,6 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import Button from '$lib/components/Inputs/Button.svelte';
import Link from '$lib/components/Inputs/Link.svelte';
import { API_KEY_PERMISSIONS } from '$lib/config';
import { get } from 'svelte/store';
@ -36,3 +37,7 @@
<Button {click}>The sharex button in question</Button>
<tt class="block mt-3 whitespace-pre-wrap">{awesome}</tt>
{#if awesome}
<Link href="data:text/plain;base64,{btoa(awesome)}" download={'uploader.sxcu'}>Download</Link>
{/if}