feat: added normal svg support for BadgeBar and made profile use badgebar

Changed files
+35 -16
src
assets
components
+1
src/assets/butterfly.svg
···
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-butterfly-icon lucide-butterfly"><path d="M15.8 2C12 3.8 12 9 12 9s0-5.2-3.8-7"/><path d="M12 9v11"/><path d="M20 5c-3.5 0-6.5 3.9-8 6.3C10.5 8.9 7.5 5 4 5a2 2 0 0 0-2 2c0 2.3.6 4.4 1.5 5.6C4 13.5 4.9 14 6 14h2c-.9.4-2.1.9-2.6 1.5-1.6 1.6-.9 3.4.7 4.9 1.6 1.6 3.4 2.3 4.9.7.3-.3 1-1.1 1-1.1s.6.8 1 1.1c1.6 1.6 3.4.9 4.9-.7 1.6-1.6 2.3-3.4.7-4.9-.5-.5-1.7-1.1-2.6-1.5h2c1.1 0 2-.5 2.5-1.4.9-1.2 1.5-3.3 1.5-5.6a2 2 0 0 0-2-2"/></svg>
+11 -3
src/components/Badgebar.astro
···
import LucideIcon from "./LucideIcon.astro";
interface Badge {
-
icon: string,
+
icon: string | any,
href: string
color: string
+
svg?: boolean
}
interface Props {
···
}
const { badges, size } = Astro.props
+
---
<span class="flex gap-2 bg-ctp-crust p-2 pl-3 pr-3 rounded-full h-min">
{badges.map(badge =>
<a href=`${badge.href}` target="_blank" rel="noopener noreferrer">
+
{ badge.svg && badge.icon && (
+
<badge.icon width={size} height={size} style={`stroke:${badge.color}`}
+
class="hover:rotate-15 hover:scale-110 ease-in hover:ease-out transition-transform active:scale-80"
+
/>
+
)}
+
{ !badge.svg && (
<LucideIcon name=`${badge.icon}` width=`${size}` height=`${size}` style={`stroke:${badge.color}`}
-
class="hover:rotate-15 ease-in hover:ease-out transition-transform"
+
class="hover:rotate-15 hover:scale-110 ease-in hover:ease-out transition-transform active:scale-80"
/>
+
)}
</a>
)}
</span>
-
+23 -13
src/components/section/Profile.astro
···
import Quote from './Quote.astro'
import { Github, Spool, Icon } from '@lucide/astro'
import { butterfly } from '@lucide/lab'
+
import BadgeBar from "../Badgebar.astro"
+
import Butterfly from "../../assets/butterfly.svg"
---
<div class="flex flex-col md:col-span-2 border border-ctp-surface0 gap-[-1px] w-full h-min">
<span class="p-4 pb-0 border-b border-ctp-surface0 relative">
···
<span class="text-2xl font-bold">Banana</span>
<a href="mailto:banana@potassium.sh" class="hover:underline ease-in hover:ease-out transition-all">banana@potassium.sh</a>
</span>
-
<span class="flex gap-2 bg-ctp-crust p-2 pl-3 pr-3 rounded-full h-min">
-
<a href="https://github.com/imabanana80" target="_blank" rel="noopener noreferrer">
-
<Github size="20"
-
class="stroke-ctp-green hover:rotate-15 ease-in hover:ease-out transition-transform" /></a>
-
<a href="https://tangled.org/@banana.tngl.sh/" target="_blank" rel="noopener noreferrer">
-
<Spool size="20"
-
class="stroke-ctp-lavender hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
-
</a>
-
<a href="https://bsky.app/profile/imabanana80.com" target="_blank" rel="noopener noreferrer">
-
<Icon iconNode={butterfly} size="20"
-
class="stroke-ctp-sapphire hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
</span>
+
<BadgeBar
+
badges={[
+
{
+
icon: "Github",
+
color: "var(--catppuccin-color-green)",
+
href: "https://github.com/imabanana80"
+
},
+
{
+
icon: "Spool",
+
color: "var(--catppuccin-color-lavender)",
+
href: "https://tangled.org/@banana.tngl.sh"
+
},
+
{
+
icon: Butterfly,
+
color: "var(--catppuccin-color-sapphire)",
+
href: "https://bsky.app/profile/imabanana80.com",
+
svg: true
+
}
+
]}
+
size='20'
+
/>
</span>
<span class="relative p-3 mt-4 border border-ctp-surface0 text-sm">
<Label name="Currently"/>