mirror of
https://github.com/youwen5/site.git
synced 2024-11-25 01:43:49 -08:00
style: Refactor SVG classes and add copy button for Discord username
This commit is contained in:
parent
0c5bfff059
commit
14c7854aa8
6 changed files with 24 additions and 12 deletions
|
@ -10,7 +10,7 @@
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
viewBox="0 0 2048 416"
|
viewBox="0 0 2048 416"
|
||||||
class="diagram select-none font-mono hidden sm:block"
|
class="diagram select-none font-mono"
|
||||||
text-anchor="middle"
|
text-anchor="middle"
|
||||||
font-size="13px"
|
font-size="13px"
|
||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
viewBox="0 0 2104 416"
|
viewBox="0 0 2104 416"
|
||||||
class="diagram select-none hidden sm:block font-mono"
|
class="diagram select-none font-mono"
|
||||||
text-anchor="middle"
|
text-anchor="middle"
|
||||||
font-size="13px"
|
font-size="13px"
|
||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
|
|
|
@ -26,13 +26,13 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="h-20 bg-background bg-opacity-50 backdrop-blur-md fixed w-full z-50">
|
<nav class="h-20 bg-background bg-opacity-50 backdrop-blur-md fixed w-full z-50">
|
||||||
<div class="container mx-auto flex justify-between items-center h-full gap-4">
|
<div class="container mx-auto flex justify-between items-center h-full gap-4 overflow-x-auto">
|
||||||
{#if current === 'blog'}
|
{#if current === 'blog'}
|
||||||
<Coredump height="95%" href="/blog" />
|
<Coredump height="95%" href="/blog" />
|
||||||
{:else}
|
{:else}
|
||||||
<Name height="100%" href="/" />
|
<Name height="100%" href="/" />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex gap-1 sm:gap-2 md:gap-4 lg:gap-14 justify-around align-middle">
|
<div class="flex gap-4 lg:gap-14 justify-around align-middle">
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
class="text-md sm:text-lg md:text-xl font-medium dark:text-zinc-50 text-zinc-700 px-4 py-1 rounded-3xl hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors duration-200"
|
class="text-md sm:text-lg md:text-xl font-medium dark:text-zinc-50 text-zinc-700 px-4 py-1 rounded-3xl hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors duration-200"
|
||||||
|
|
|
@ -5,17 +5,28 @@
|
||||||
GithubLogo,
|
GithubLogo,
|
||||||
LinkedinLogo,
|
LinkedinLogo,
|
||||||
DiscordLogo,
|
DiscordLogo,
|
||||||
EnvelopeClosed
|
EnvelopeClosed,
|
||||||
|
ClipboardCopy
|
||||||
} from 'svelte-radix';
|
} from 'svelte-radix';
|
||||||
import * as Popover from '$lib/components/ui/popover';
|
import * as Popover from '$lib/components/ui/popover';
|
||||||
|
|
||||||
export let center = false;
|
export let center = false;
|
||||||
|
|
||||||
import Button from './ui/button/button.svelte';
|
import Button from './ui/button/button.svelte';
|
||||||
import PopoverContent from './ui/popover/popover-content.svelte';
|
import { toast } from 'svelte-sonner';
|
||||||
|
|
||||||
|
const copyDiscord = async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText('couscousdude');
|
||||||
|
toast('Copied Discord username to clipboard');
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
toast('Failed to copy Discord username to clipboard');
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex gap-2 mt-2" class:justify-center={center}>
|
<div class="flex gap-2 mt-2 flex-wrap" class:justify-center={center}>
|
||||||
<Button variant="ghost" size="icon" href="https://github.com/couscousdude">
|
<Button variant="ghost" size="icon" href="https://github.com/couscousdude">
|
||||||
<GithubLogo />
|
<GithubLogo />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -37,6 +48,9 @@
|
||||||
<Popover.Content>
|
<Popover.Content>
|
||||||
Discord (for some reason) doesn't support direct links to profiles. You can find me on discord
|
Discord (for some reason) doesn't support direct links to profiles. You can find me on discord
|
||||||
with my username, <strong>@couscousdude</strong>.
|
with my username, <strong>@couscousdude</strong>.
|
||||||
|
<Button variant="outline" size="icon" on:click={copyDiscord} class="mt-2"
|
||||||
|
><ClipboardCopy /></Button
|
||||||
|
>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
</Popover.Root>
|
</Popover.Root>
|
||||||
<Popover.Root>
|
<Popover.Root>
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
<main class="background px-4">
|
<main class="background px-4">
|
||||||
<div class="container max-w-4xl 2xl:max-w-5xl mx-auto p-10">
|
<div class="container max-w-4xl 2xl:max-w-5xl mx-auto p-10">
|
||||||
<Typewriter mode="scramble" scrambleDuration={750}>
|
<Typewriter mode="scramble" scrambleDuration={750}>
|
||||||
<h1 class="text-4xl md:text-6xl font-bold text-center tracking-tight mt-20">
|
<h1 class="text-6xl font-bold text-center tracking-tight mt-20">👋 Hi, I'm Youwen,</h1>
|
||||||
👋 Hi, I'm Youwen,
|
|
||||||
</h1>
|
|
||||||
</Typewriter>
|
</Typewriter>
|
||||||
<div class="text-2xl md:text-3xl font-medium mt-10 text-center">
|
<div class="text-2xl md:text-3xl font-medium mt-10 text-center">
|
||||||
<Typewriter cursor mode="loop">
|
<Typewriter cursor mode="loop">
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
<meta name="author" content="Youwen Wu" />
|
<meta name="author" content="Youwen Wu" />
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<main class="container max-w-5xl mx-auto my-8">
|
<main class="max-w-4xl my-8 mx-4 md:mx-auto">
|
||||||
<div class="mx-auto w-full min-w-0 mb-4">
|
<div class="w-full min-w-0 mb-4">
|
||||||
<div class="mb-4 flex items-center space-x-1 text-sm text-muted-foreground">
|
<div class="mb-4 flex items-center space-x-1 text-sm text-muted-foreground">
|
||||||
<div class="overflow-hidden text-ellipsis whitespace-nowrap">Docs</div>
|
<div class="overflow-hidden text-ellipsis whitespace-nowrap">Docs</div>
|
||||||
<ChevronRight class="h-4 w-4" />
|
<ChevronRight class="h-4 w-4" />
|
||||||
|
|
Loading…
Reference in a new issue