feat: rework home page and move profile to seperate component

Changed files
+77 -47
src
components
layouts
pages
+73
src/components/Profile.astro
···
···
+
---
+
import Tag from '../components/Tag.astro';
+
import { Github, Twitch, Youtube, Icon } from '@lucide/astro'
+
import { butterfly } from '@lucide/lab'
+
---
+
<div class="flex flex-col 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">
+
<img src="/banner.png" class="w-full"/>
+
</span>
+
<div class="p-8 pt-12 flex-col flex flex-wrap relative">
+
<img src="doodlecat.png" width="96px" height="96px"
+
class="rounded-full absolute -top-12 left-8 border-6 border-ctp-mantle" />
+
<span class="text-base flex justify-between w-full flex-wrap gap-2">
+
<span class="flex flex-col">
+
<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">
+
<Github size="20"
+
class="stroke-ctp-green hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
+
<a href="https://bsky.app/profile/imabanana80.com">
+
<Icon iconNode={butterfly} size="20"
+
class="stroke-ctp-sapphire hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
+
<a href="https://twitch.tv/imabanana80">
+
<Twitch size="20"
+
class="stroke-ctp-mauve hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
+
<a href="https://youtube.com/@imabanana80">
+
<Youtube size="20"
+
class="stroke-ctp-red hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
+
</span>
+
</span>
+
<span class="relative p-3 mt-4 border border-ctp-surface0 text-sm">
+
<Tag name="About"/>
+
Hi, I'm Banana, a computer science student and software developer that specialises in
+
Web Development as well as developing and hosting Minecraft Events.
+
</span>
+
<span class="relative p-3 mt-4 border border-ctp-surface0 text-sm">
+
<Tag name="Currently"/>
+
Learning Svelte | Open for Hire
+
</span>
+
<span class="relative p-3 -mt-px border border-ctp-surface0 text-ctp-subtext0 text-sm">
+
<Tag name="Time"/>
+
<span id="clock" class="text-ctp-text"></span> (SGT/UTC+8)
+
</span>
+
</div >
+
</div>
+
+
+
<script>
+
const clockElement: HTMLElement | null = document.getElementById("clock");
+
+
if (!clockElement) {
+
console.error(`Error: Clock element with ID "clock" not found.`);
+
}
+
+
const displayTime = (): void => {
+
const now: Date = new Date();
+
+
const options: Intl.DateTimeFormatOptions = {
+
hour: '2-digit',
+
minute: '2-digit',
+
second: '2-digit',
+
hour12: false,
+
timeZone: "Asia/Singapore"
+
};
+
+
const timeString: string = now.toLocaleTimeString('en-US', options);
+
clockElement.textContent = timeString;
+
};
+
displayTime();
+
setInterval(displayTime, 1000);
+
</script>
+1 -1
src/layouts/Layout.astro
···
<meta name="generator" content={Astro.generator} />
<title>banana@potassium.sh</title>
</head>
-
<body class="bg-ctp-crust pl-64 pr-64 text-ctp-text">
<main class="w-full min-h-full max-h-max bg-ctp-mantle">
<Navbar/>
<slot />
···
<meta name="generator" content={Astro.generator} />
<title>banana@potassium.sh</title>
</head>
+
<body class="bg-ctp-crust pl-[12%] pr-[12%] text-ctp-text">
<main class="w-full min-h-full max-h-max bg-ctp-mantle">
<Navbar/>
<slot />
+3 -46
src/pages/index.astro
···
---
import Layout from '../layouts/Layout.astro';
-
import Tag from '../components/Tag.astro';
-
import { Github, Twitch, Youtube, Icon } from '@lucide/astro'
-
import { butterfly } from '@lucide/lab'
---
<script>
const clockElement: HTMLElement | null = document.getElementById("clock");
···
</script>
<Layout>
<section class="h-[50%] grid-cols-5 grid p-32 gap-12">
-
<div class="flex flex-col col-span-3 gap-3 p-8 border-ctp-surface0 border h-min">
<span class="text-5xl font-semibold">
Hi, I'm Banana.
</span>
···
I'm a computer science student and software developer that specialises in
Web Development as well as developing and hosting Minecraft Events.
</span>
-
</div>
-
<div class="flex flex-col 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">
-
<img src="/banner.png" class="w-full"/>
-
</span>
-
<div class="p-8 pt-12 flex-col flex relative">
-
<img src="doodlecat.png" width="96px" height="96px"
-
class="rounded-full absolute -top-12 left-8 border-6 border-ctp-mantle" />
-
<span class="text-base flex justify-between">
-
<span class="flex flex-col">
-
<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">
-
<Github size="20"
-
class="stroke-ctp-green hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
<a href="https://bsky.app/profile/imabanana80.com">
-
<Icon iconNode={butterfly} size="20"
-
class="stroke-ctp-sapphire hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
<a href="https://twitch.tv/imabanana80">
-
<Twitch size="20"
-
class="stroke-ctp-mauve hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
<a href="https://youtube.com/@imabanana80">
-
<Youtube size="20"
-
class="stroke-ctp-red hover:rotate-15 ease-in hover:ease-out transition-transform"/></a>
-
</span>
-
</span>
-
<span class="relative p-3 mt-4 border border-ctp-surface0 text-sm">
-
<Tag name="About"/>
-
Hi, I'm Banana, a computer science student and software developer that specialises in
-
Web Development as well as developing and hosting Minecraft Events.
-
</span>
-
<span class="relative p-3 mt-4 border border-ctp-surface0 text-sm">
-
<Tag name="Currently"/>
-
Learning Svelte | Open for Hire
-
</span>
-
<span class="relative p-3 -mt-px border border-ctp-surface0 text-ctp-subtext0 text-sm">
-
<Tag name="Time"/>
-
<span id="clock" class="text-ctp-text"></span> (SGT/UTC+8)
-
</span>
-
</div >
</div>
</section>
</Layout>
···
---
import Layout from '../layouts/Layout.astro';
+
import Profile from "../components/Profile.astro"
---
<script>
const clockElement: HTMLElement | null = document.getElementById("clock");
···
</script>
<Layout>
<section class="h-[50%] grid-cols-5 grid p-32 gap-12">
+
<Profile/>
+
<div class="flex flex-col col-span-3 gap-3 p-8 border-ctp-surface0 border h-min">
<span class="text-5xl font-semibold">
Hi, I'm Banana.
</span>
···
I'm a computer science student and software developer that specialises in
Web Development as well as developing and hosting Minecraft Events.
</span>
</div>
</section>
</Layout>