feat: add pinned section to home

Changed files
+121 -1
src
+72
src/components/Pinned.astro
···
···
+
---
+
import Tag from "./Tag.astro"
+
import Item from "./PinnedItem.astro"
+
---
+
+
<div class="flex flex-col p-8 border-ctp-surface0 border w-full h-min relative">
+
<Tag name="Pinned"/>
+
<div class="flex flex-wrap">
+
<Item
+
type="project"
+
title="IsleStats"
+
subtitle="An MCC Island Discord statistics bot that renders beautiful stat cards to show off your stats."
+
icon="Archive"
+
href="https://islestats.net"
+
badges={[
+
{
+
icon: "Github",
+
href: "https://github.com/islestats",
+
color: "var(--catppuccin-color-green)"
+
},
+
{
+
icon: "MessageCircle",
+
href: "https://discord.gg//islestats",
+
color: "var(--catppuccin-color-blue)"
+
},
+
{
+
icon: "Mail",
+
href: "mailto:contact@islestats.net",
+
color: "var(--catppuccin-color-maroon)"
+
}
+
]}
+
/>
+
<Item
+
type="team"
+
title="potassium.sh"
+
subtitle="An indie software development studio for the creative and insane, founded by me!"
+
icon="Users"
+
href="https://tangled.org/@banana.tngl.sh/dotfiles"
+
badges={[
+
{
+
icon: "Mail",
+
href: "mailto:team@potassium.sh",
+
color: "var(--catppuccin-color-maroon)"
+
},
+
{
+
icon: "Spool",
+
href: "https://tangled.org/@potassium.sh",
+
color: "var(--catppuccin-color-lavender)"
+
},
+
{
+
icon: "Bird",
+
href: "https://bsky.app/profile/potassium.sh",
+
color: "var(--catppuccin-color-sapphire)"
+
},
+
]}
+
/>
+
<Item
+
type="repo"
+
title="dotfiles"
+
subtitle="My personal configuration dotfiles for endeavouros linux."
+
icon="BookMarked"
+
href="https://tangled.org/@banana.tngl.sh/dotfiles"
+
badges={[
+
{
+
icon: "Book",
+
href: "https://wiki.archlinux.org/title/Dotfiles",
+
color: "var(--catppuccin-color-sapphire)"
+
},
+
]}
+
/>
+
</div>
+
</div>
+46
src/components/PinnedItem.astro
···
···
+
---
+
interface Badge {
+
icon: string,
+
href: string
+
color: string
+
}
+
+
interface Props {
+
type: string
+
icon: string,
+
title: string,
+
subtitle: string,
+
href: string
+
badges: Badge[]
+
}
+
+
const { type, title, subtitle, icon, badges, href } = Astro.props
+
+
var color
+
if (type=="project") {
+
color = "--catppuccin-color-red"
+
} else if (type=="repo") {
+
color = "--catppuccin-color-peach"
+
} else if (type=="team") {
+
color = "--catppuccin-color-mauve"
+
} else if (type=="misc") {
+
color = "--catppuccin-color-maroon"
+
}
+
color = "var(" + color + ")"
+
+
import LucideIcon from "./LucideIcon.astro";
+
import Badgebar from "./Badgebar.astro"
+
---
+
<div class="p-4 border border-ctp-surface0 flex flex-col -mt-px w-full">
+
<div class="flex justify-between gap-16">
+
<a href=`${href}` class="flex flex-col gap-1 group">
+
<span class="text-xl flex gap-2 items-center font-bold group-hover:underline">
+
<LucideIcon name=`${icon}` width="20" height="20" style={`stroke:${color}`} /> {title}</span>
+
<span class="text-sm">
+
<span class="flex gap-1">{subtitle}</span>
+
</span>
+
</a>
+
<Badgebar badges={badges} size="20"/>
+
</div>
+
</div>
+
+3 -1
src/pages/index.astro
···
import Profile from "../components/Profile.astro";
import Contributions from "../components/Contributions.astro"
---
<Layout>
<section class="h-[50%] grid-cols-5 grid p-24 pt-48 gap-16">
<Profile/>
-
<div class="col-span-3 gap-8 flex flex-col">
<Contributions/>
</div>
</section>
</Layout>
···
import Profile from "../components/Profile.astro";
import Contributions from "../components/Contributions.astro"
+
import Pinned from "../components/Pinned.astro"
---
<Layout>
<section class="h-[50%] grid-cols-5 grid p-24 pt-48 gap-16">
<Profile/>
+
<div class="col-span-3 gap-16 flex flex-col">
<Contributions/>
+
<Pinned/>
</div>
</section>
</Layout>