2024-09-13 17:00:03 -07:00
|
|
|
<script lang="ts">
|
|
|
|
import { routes } from "./sitemap.ts"
|
|
|
|
import { Separator } from "$lib/components/ui/separator/index.js";
|
|
|
|
let scrollPosition: number = .5;
|
|
|
|
let scrollHeight: number = 1;
|
|
|
|
let progress: number = 0;
|
|
|
|
|
2024-09-14 18:37:13 -07:00
|
|
|
function onScroll() {
|
2024-09-13 17:00:03 -07:00
|
|
|
if (scrollHeight > 1) {
|
2024-09-14 18:37:13 -07:00
|
|
|
progress = Math.max(0, Math.min(1, scrollPosition / scrollHeight));
|
2024-09-13 17:00:03 -07:00
|
|
|
}
|
|
|
|
}
|
2024-09-13 21:24:33 -07:00
|
|
|
|
|
|
|
import type { PageData } from './$types';
|
|
|
|
export let data: PageData;
|
|
|
|
const { name, Content } = data;
|
2024-09-14 00:59:54 -07:00
|
|
|
|
|
|
|
import metadata from '$content/metadata.json';
|
2024-09-14 18:06:29 -07:00
|
|
|
const iconMap: Map<string, string> = {
|
|
|
|
"github": "fa-brands fa-github",
|
|
|
|
"open-source": "fa-brands fa-osi",
|
|
|
|
"orcid": "fa-brands fa-orcid",
|
|
|
|
"instagram": "fa-brands fa-instagram",
|
|
|
|
"email": "fa-solid fa-envelope",
|
|
|
|
};
|
|
|
|
const iconLinks: [string, string][] = Object.entries(metadata.links).map(
|
|
|
|
([key, link]) => [iconMap[key], link]);
|
2024-09-13 17:00:03 -07:00
|
|
|
</script>
|
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
<svelte:head>
|
|
|
|
<title>{metadata.name}</title>
|
|
|
|
</svelte:head>
|
|
|
|
|
2024-09-13 17:00:03 -07:00
|
|
|
<div
|
|
|
|
id="background"
|
2024-09-14 00:59:54 -07:00
|
|
|
style="opacity: {1 - progress}; background-image: url('{metadata.frontCover}')"
|
2024-09-13 17:00:03 -07:00
|
|
|
>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="front">
|
|
|
|
<div id="floater">
|
2024-09-14 18:14:02 -07:00
|
|
|
<p class="text-lg floater-elem" style="color: #888">{metadata.frontDescription}</p>
|
2024-09-13 17:00:03 -07:00
|
|
|
<div
|
|
|
|
class="floater-elem"
|
|
|
|
style="padding-bottom: {(1 - progress) * 50}vh"
|
|
|
|
>
|
|
|
|
<div class="flex h-5 items-center space-x-4 text-sm">
|
2024-09-14 18:14:02 -07:00
|
|
|
<a class="navbar-link" href="#bio">Bio</a>
|
2024-09-13 17:00:03 -07:00
|
|
|
{#each routes as item}
|
|
|
|
{#if item.route !== "/"}
|
|
|
|
<Separator orientation="vertical" />
|
2024-09-14 18:14:02 -07:00
|
|
|
<a class="navbar-link" href={item.route}>{item.name}</a>
|
2024-09-13 17:00:03 -07:00
|
|
|
{/if}
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-09-14 18:06:29 -07:00
|
|
|
|
|
|
|
<div id="main">
|
|
|
|
<div id="bio" class="bg-white dark:bg-gray-900" style="">
|
|
|
|
<div class="p-1">
|
|
|
|
<div class="flex">
|
|
|
|
<div id="info flex-col">
|
|
|
|
<p id="bio-name">{name}</p>
|
|
|
|
<div class="w-100">
|
|
|
|
{#each iconLinks as [cl, link]}
|
|
|
|
<a class="icon m-1" href={link}><i class="fa-xl {cl}"></i></a>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="avatar">
|
|
|
|
<img src={metadata.avatar} alt={metadata.name} />
|
|
|
|
</div>
|
2024-09-14 15:48:25 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-09-14 19:01:40 -07:00
|
|
|
<article id="bio-core" class="prose lg:prose-xl dark:prose-invert">
|
2024-09-14 18:06:29 -07:00
|
|
|
<Content />
|
|
|
|
</article>
|
2024-09-14 00:59:54 -07:00
|
|
|
</div>
|
2024-09-13 17:00:03 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<svelte:window
|
|
|
|
bind:scrollY={scrollPosition}
|
|
|
|
bind:innerHeight={scrollHeight}
|
|
|
|
on:scroll={onScroll}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#background {
|
|
|
|
background-attachment: fixed;
|
|
|
|
background-size: 100%;
|
|
|
|
background-position: center;
|
|
|
|
z-index: -10;
|
|
|
|
position: absolute;
|
|
|
|
min-width: 100vw;
|
|
|
|
min-height: 100vh;
|
|
|
|
}
|
|
|
|
#front {
|
|
|
|
height: 100vh;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
#floater {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
margin-top: auto;
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
.floater-elem {
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
2024-09-14 18:06:29 -07:00
|
|
|
#main {
|
|
|
|
width: 100%;
|
|
|
|
box-shadow:
|
|
|
|
0px -5px 10px 10px rgba(200,200,200,0.4);
|
|
|
|
}
|
2024-09-14 00:59:54 -07:00
|
|
|
#bio {
|
2024-09-14 18:14:02 -07:00
|
|
|
max-width: max(50vw, 100vh);
|
2024-09-14 00:59:54 -07:00
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
padding-top: 20px;
|
2024-09-14 18:06:29 -07:00
|
|
|
padding-left: 10px;
|
|
|
|
padding-right: 10px;
|
2024-09-14 00:59:54 -07:00
|
|
|
min-height: 100vh;
|
|
|
|
}
|
|
|
|
#bio-name {
|
2024-09-14 18:06:29 -07:00
|
|
|
font-family: serif;
|
2024-09-14 15:48:25 -07:00
|
|
|
font-size: 10vh;
|
|
|
|
line-height: 10vh;
|
|
|
|
display: inline-block;
|
2024-09-14 18:06:29 -07:00
|
|
|
color: theme('colors.java.800');
|
2024-09-14 15:48:25 -07:00
|
|
|
}
|
|
|
|
#avatar {
|
|
|
|
line-height: 0;
|
|
|
|
display: inline-block;
|
|
|
|
margin: 5px;
|
|
|
|
border: 4px solid rgba(100,100,100,0.4);
|
|
|
|
border-radius: 50%;
|
|
|
|
margin-right: auto;
|
|
|
|
@apply ml-auto mr-0;
|
|
|
|
}
|
|
|
|
#avatar img {
|
|
|
|
width: 20vh;
|
|
|
|
height: 20vh;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
2024-09-14 19:01:40 -07:00
|
|
|
#bio-core {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
#bio-core > :global(*):not(h1):not(h2) {
|
|
|
|
margin-left: 50px;
|
|
|
|
}
|
|
|
|
#bio-core > :global(h1) {
|
|
|
|
color: theme('colors.eucalyptus.700');
|
|
|
|
font-weight: normal;
|
|
|
|
border-bottom: 1px solid;
|
2024-09-14 00:59:54 -07:00
|
|
|
}
|
2024-09-13 17:00:03 -07:00
|
|
|
</style>
|