mirror of
https://github.com/youwen5/site.git
synced 2024-11-28 10:53:50 -08:00
fix: removed gpg component that was breaking everything
THIS TOOK ME 4 HOURS
This commit is contained in:
parent
106dbc9349
commit
4d578139af
4 changed files with 2 additions and 68 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ node_modules
|
||||||
!.env.example
|
!.env.example
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
vite.config.ts.timestamp-*
|
vite.config.ts.timestamp-*
|
||||||
|
.vercel
|
|
@ -1,57 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import * as AlertDialog from '$lib/components/ui/alert-dialog';
|
|
||||||
import { onMount } from 'svelte';
|
|
||||||
import { toast } from 'svelte-sonner';
|
|
||||||
import ScrollArea from './ui/scroll-area/scroll-area.svelte';
|
|
||||||
|
|
||||||
let gpg: Promise<string>;
|
|
||||||
|
|
||||||
async function getGpg() {
|
|
||||||
const res = await fetch(`/youwen.gpg`);
|
|
||||||
const text = await res.text();
|
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
return text;
|
|
||||||
} else {
|
|
||||||
throw new Error(text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function copyGpg() {
|
|
||||||
try {
|
|
||||||
const text = await gpg;
|
|
||||||
navigator.clipboard.writeText(text);
|
|
||||||
toast('Copied GPG key to clipboard');
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
toast('Failed to copy GPG key to clipboard');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onMount(() => {
|
|
||||||
gpg = getGpg();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<AlertDialog.Root>
|
|
||||||
<AlertDialog.Trigger><slot /></AlertDialog.Trigger>
|
|
||||||
<AlertDialog.Content>
|
|
||||||
<AlertDialog.Header>
|
|
||||||
<AlertDialog.Title>GPG Key</AlertDialog.Title>
|
|
||||||
<AlertDialog.Description class="flex justify-center">
|
|
||||||
{#await gpg then text}
|
|
||||||
<ScrollArea class="max-h-60 mb-4 max-w-60" orientation="both">
|
|
||||||
<p>{text}</p>
|
|
||||||
</ScrollArea>
|
|
||||||
{:catch}
|
|
||||||
<p class="text-destructive">Couldn't fetch GPG key.</p>
|
|
||||||
{/await}
|
|
||||||
</AlertDialog.Description>
|
|
||||||
</AlertDialog.Header>
|
|
||||||
<AlertDialog.Footer class="gap-1">
|
|
||||||
<a href="/youwen.gpg" download>
|
|
||||||
<AlertDialog.Action>Download</AlertDialog.Action>
|
|
||||||
</a>
|
|
||||||
<AlertDialog.Action on:click={copyGpg}>Copy</AlertDialog.Action>
|
|
||||||
<AlertDialog.Cancel>Close</AlertDialog.Cancel>
|
|
||||||
</AlertDialog.Footer>
|
|
||||||
</AlertDialog.Content>
|
|
||||||
</AlertDialog.Root>
|
|
|
@ -6,15 +6,9 @@
|
||||||
import Button from '../ui/button/button.svelte';
|
import Button from '../ui/button/button.svelte';
|
||||||
import { Sun, Moon, Home, Person, File, Backpack } from 'svelte-radix';
|
import { Sun, Moon, Home, Person, File, Backpack } from 'svelte-radix';
|
||||||
import ThemePicker from '../ThemePicker.svelte';
|
import ThemePicker from '../ThemePicker.svelte';
|
||||||
|
|
||||||
let open: boolean = false;
|
|
||||||
|
|
||||||
const close = () => {
|
|
||||||
open = false;
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Drawer.Root shouldScaleBackground direction="top" bind:open>
|
<Drawer.Root shouldScaleBackground direction="top">
|
||||||
<Drawer.Trigger asChild let:builder>
|
<Drawer.Trigger asChild let:builder>
|
||||||
<Button variant="outline" size="icon" builders={[builder]} class="px-2 md:hidden">
|
<Button variant="outline" size="icon" builders={[builder]} class="px-2 md:hidden">
|
||||||
<HamburgerMenu class="icon border-1 border-primary" />
|
<HamburgerMenu class="icon border-1 border-primary" />
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Gpg from '$lib/components/Gpg.svelte';
|
|
||||||
import Socials from '$lib/components/Socials.svelte';
|
import Socials from '$lib/components/Socials.svelte';
|
||||||
import Button from '$lib/components/ui/button/button.svelte';
|
import Button from '$lib/components/ui/button/button.svelte';
|
||||||
import * as Card from '$lib/components/ui/card';
|
import * as Card from '$lib/components/ui/card';
|
||||||
|
@ -98,9 +97,6 @@
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<h3>Find me on:</h3>
|
<h3>Find me on:</h3>
|
||||||
<Socials />
|
<Socials />
|
||||||
<Gpg>
|
|
||||||
<Button variant="outline" class="mt-4"><span class="mr-2">🔑</span> My GPG Key</Button>
|
|
||||||
</Gpg>
|
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card.Root>
|
</Card.Root>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue