Added lab page

This commit is contained in:
Michael
2024-11-01 00:52:40 +13:00
parent 9d6fafd101
commit fb19e55139
4 changed files with 47 additions and 60 deletions
+4 -17
View File
@@ -1,5 +1,6 @@
---
import type { CollectionEntry } from "astro:content";
import LinkCard from "./LinkCard.astro";
type Props = {
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">;
@@ -8,20 +9,6 @@ type Props = {
const { entry } = Astro.props;
---
<a href={`/${entry.collection}/${entry.slug}`} class="relative group flex flex-nowrap py-3 px-4 pr-10 rounded-lg border border-black/15 dark:border-white/20 hover:bg-black/5 dark:hover:bg-white/5 hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out">
<div class="flex flex-col flex-1 truncate">
<div class="font-semibold">
{entry.data.title}
</div>
<div class="text-sm">
{entry.data.description}
</div>
</div>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
class="absolute top-1/2 right-2 -translate-y-1/2 size-5 stroke-2 fill-none stroke-current">
<line x1="5" y1="12" x2="19" y2="12" class="translate-x-3 group-hover:translate-x-0 scale-x-0 group-hover:scale-x-100 transition-transform duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="-translate-x-1 group-hover:translate-x-0 transition-transform duration-300 ease-in-out" />
</svg>
</a>
<LinkCard href={`/${entry.collection}/${entry.slug}`} heading={entry.data.title} subheading={entry.data.description}>
</LinkCard>
+6
View File
@@ -28,6 +28,12 @@ import { SITE } from "@consts";
<Link href="/projects">
projects
</Link>
<span>
{`/`}
</span>
<Link href="/lab">
lab
</Link>
</nav>
</div>
</Container>
+28
View File
@@ -0,0 +1,28 @@
---
type Props = {
heading: string;
subheading: string;
href: string;
target?: string;
}
const { heading, subheading, href, target="" } = Astro.props;
---
<a href={href} target={target} class="relative group flex flex-nowrap py-3 px-4 pr-10 rounded-lg border border-black/15 dark:border-white/20 hover:bg-black/5 dark:hover:bg-white/5 hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out">
<div class="flex flex-col flex-1 truncate">
<div class="font-semibold">
{heading}
</div>
<div class="text-sm">
{subheading}
</div>
</div>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
class="absolute top-1/2 right-2 -translate-y-1/2 size-5 stroke-2 fill-none stroke-current">
<line x1="5" y1="12" x2="19" y2="12" class="translate-x-3 group-hover:translate-x-0 scale-x-0 group-hover:scale-x-100 transition-transform duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="-translate-x-1 group-hover:translate-x-0 transition-transform duration-300 ease-in-out" />
</svg>
</a>