site/src/routes/blog/+page.svelte

103 lines
3.2 KiB
Svelte
Raw Normal View History

<script lang="ts">
import ChevronRight from 'svelte-radix/ChevronRight.svelte';
import * as Card from '$lib/components/ui/card';
import Code from 'svelte-radix/Code.svelte';
import type { PageData } from './$types.js';
// import { config } from '$lib/stores/index.js';
import { cn } from '$lib/utils.js';
import Separator from '$lib/components/ui/separator/separator.svelte';
2024-04-05 03:47:55 -07:00
import Coredump from '$lib/assets/Coredump.svelte';
import { fly } from 'svelte/transition';
import { onMount } from 'svelte';
import PostCard from '$lib/components/Blog/PostCard.svelte';
import { faker } from '@faker-js/faker';
let loaded = false;
onMount(() => {
loaded = true;
});
2024-04-02 23:01:04 -07:00
</script>
<svelte:head>
<title>Youwen Wu | The Coredump</title>
2024-04-05 03:47:55 -07:00
<meta name="description" content="My blog on computer science, math, games, art, and more." />
2024-04-02 23:01:04 -07:00
<meta name="author" content="Youwen Wu" />
</svelte:head>
<main class="dots-background">
2024-04-05 03:57:29 -07:00
<div class="max-w-5xl md:mx-auto py-12 my-1 container px-4">
2024-04-05 03:47:55 -07:00
<!-- <h1 class="text-5xl md:text-6xl font-serif font-bold mt-14 sm:mt-18">The Coredump</h1> -->
{#if loaded}
<Coredump width="100%" height="auto" transition="vertical" />
<p
class="text-xl sm:text-2xl text-muted-foreground font-mono"
in:fly={{ duration: 300, y: -50, delay: 200 }}
>
my blog on computer science, math, games, art, and more.
</p>
<div class="grid grid-cols-3 mt-20 gap-8">
<div class="col-span-3 md:col-span-2">
<h2 class="text-4xl font-serif font-bold" in:fly|global={{ y: -50, delay: 300 }}>
Latest Posts
</h2>
{#each Array(5) as _, i}
2024-04-05 03:47:55 -07:00
<div
class="grid grid-cols-1 gap-4 mt-8"
in:fly|global={{ x: -50, delay: 350 + i * 100 }}
>
<PostCard
title={faker.hacker.noun() +
' ' +
faker.hacker.verb() +
' ' +
faker.hacker.adjective() +
' ' +
faker.hacker.noun()}
blurb={faker.hacker.phrase()}
description={faker.lorem.paragraphs(2)}
/>
</div>
{/each}
2024-04-05 03:47:55 -07:00
</div>
<div in:fly={{ y: -50, delay: 300 }} class="col-span-3 md:col-span-1">
<Card.Root class="bg-primary-foreground backdrop-blur-sm border-primary/10">
<Card.Header>
<h2 class="text-3xl font-serif font-bold mb-6">Archive</h2>
<h3 class="text-3xl font-serif font-medium text-muted-foreground">2024</h3>
<Separator class="mt-4 bg-primary/10 h-1" />
</Card.Header>
<Card.Content>
{#each Array(5) as _, i}
<div class="grid grid-cols-1 gap-2 mb-8">
<h3 class="text-2xl font-serif font-bold">
{faker.hacker.noun() +
' ' +
faker.hacker.verb() +
' ' +
faker.hacker.adjective() +
' ' +
faker.hacker.noun()}
</h3>
<p class="text-lg text-muted-foreground">
{faker.hacker.phrase()}
</p>
<div class="flex items-center gap-2">
<a href="/blog/2021/01" class="text-primary hover:underline text-lg font-serif"
>Read more</a
>
<ChevronRight class="w-6 h-6 text-primary" />
</div>
</div>
{/each}
</Card.Content>
</Card.Root>
</div>
</div>
{:else}
<div class="h-screen"></div>
{/if}
</div>
</main>