setup site and nav
This commit is contained in:
parent
b7ca9ce497
commit
afe035a40c
4 changed files with 45 additions and 3 deletions
28
src/lib/components/Navbar.svelte
Normal file
28
src/lib/components/Navbar.svelte
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<script lang="ts">
|
||||
interface Props {
|
||||
pages: { slug: string; name: string }[];
|
||||
route: { id: string | null };
|
||||
}
|
||||
|
||||
let { pages, route }: Props = $props();
|
||||
</script>
|
||||
|
||||
<nav class="navbar px-12">
|
||||
<div class="flex flex-1 items-center gap-4">
|
||||
<div class="avatar avatar-placeholder">
|
||||
<div
|
||||
class="ring-accent ring-offset-base-100 bg-base-200 text-neutral-content w-10 rounded-full ring ring-offset-2"
|
||||
>
|
||||
<span>B</span>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="text-3xl"><b>Benjamin</b> Palko</h2>
|
||||
</div>
|
||||
<div class="flex gap-4 text-lg">
|
||||
{#each pages as page (page.slug)}
|
||||
<a href={page.slug} class="link hover:link-accent" class:link-accent={route.id === page.slug}>
|
||||
{page.name}
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -1,9 +1,23 @@
|
|||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import Navbar from '$lib/components/Navbar.svelte';
|
||||
import '../app.css';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
const pages = [
|
||||
{ slug: '/about', name: 'About Me' },
|
||||
{ slug: '/portfolio', name: 'Portfolio' },
|
||||
{ slug: '/blog', name: 'Blog' },
|
||||
{ slug: '/projects', name: 'Projects' },
|
||||
{ slug: '/experience', name: 'Experience' },
|
||||
{ slug: '/contact', name: 'Contact' }
|
||||
];
|
||||
</script>
|
||||
|
||||
<div class="h-screen w-screen">
|
||||
<nav></nav>
|
||||
{@render children()}
|
||||
<div class="h-screen w-screen p-12">
|
||||
<div class="bg-base-200 flex min-h-full flex-col gap-8 rounded-4xl p-8">
|
||||
<Navbar {pages} route={page.route} />
|
||||
<div class="px-8">{@render children()}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
0
src/routes/blog/+page.svelte
Normal file
0
src/routes/blog/+page.svelte
Normal file
0
src/routes/portfolio/+page.svelte
Normal file
0
src/routes/portfolio/+page.svelte
Normal file
Loading…
Add table
Add a link
Reference in a new issue