website/src/pages/projects.astro

154 lines
5.6 KiB
Text
Raw Normal View History

2022-12-08 16:52:33 +01:00
---
import Layout from "../layouts/Layout.astro";
import Navbar from "../components/widgets/Navbar.astro";
import Container from "../components/atoms/Container.astro";
2022-12-09 14:11:57 +01:00
interface Project {
name: string;
link: string;
desc: string;
stats?: {
forks: number;
stars: number;
};
}
const projects: Project[] = [
2022-12-31 18:50:30 +01:00
{
name: "HyLib",
link: "https://github.com/xHyroM/HyLib",
desc: "Source code for HyLib, a paper plugin and powerful library.",
},
{
name: "HyChat",
link: "https://github.com/xHyroM/HyChat",
desc: "Source code for HyChat, a paper plugin.",
},
2022-12-09 14:11:57 +01:00
{
2022-12-12 17:19:10 +01:00
name: "HyX",
2022-12-31 18:50:30 +01:00
link: "https://github.com/xHyroM/HyX",
2022-12-12 17:19:10 +01:00
desc: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, quaerat.",
2022-12-09 16:55:43 +01:00
},
2022-12-31 18:50:30 +01:00
{
name: "Mashe",
link: "https://github.com/xHyroM/mashe",
desc: "Simple, fast, and easy to use Event Handling for Java.",
2022-12-31 18:50:30 +01:00
},
{
name: "Mumblum",
link: "https://github.com/xHyroM/mumblum",
desc: "Mumblum is a simple, modern discord bot in JDA.",
},
{
name: "setup-bun",
link: "https://github.com/xHyroM/setup-bun",
desc: "Set up your GitHub Actions workflow with a specific version of Bun.",
},
{
name: "Roles Bot",
link: "https://github.com/xHyroM/roles-bot",
2023-01-04 12:15:08 +01:00
desc: 'Discord bot for "button" roles, using Cloudflare Workers.',
},
{
name: "Bun Discord Bot",
link: "https://github.com/xHyroM/bun-discord-bot",
2023-01-04 12:15:08 +01:00
desc: "Official serverless discord bot for bun discord server.",
},
{
name: "hykord",
link: "https://github.com/xHyroM/hykord",
2023-01-04 12:15:08 +01:00
desc: "My @discord client modification.",
},
{
name: "frog",
link: "https://github.com/xHyroM/frog",
2023-01-04 12:15:08 +01:00
desc: "Frog is an extremely simple language based on the monkey language.",
},
2022-12-09 14:11:57 +01:00
];
for (const project of projects) {
2023-01-04 12:15:08 +01:00
const repository = await (
await fetch(`https://api.github.com/repos/${project.link.slice(19)}`, {
headers: {
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
},
})
).json();
project.stats = {
forks: repository.forks,
2023-01-04 12:15:08 +01:00
stars: repository.stargazers_count,
};
}
2022-12-08 16:52:33 +01:00
---
<Layout>
<Navbar />
2023-01-04 12:15:08 +01:00
<h1 class="w-full py-32 text-center text-5xl font-extrabold text-white">
2022-12-08 16:52:33 +01:00
Projects
</h1>
2022-12-09 13:26:17 +01:00
<Container>
2023-01-04 12:15:08 +01:00
<main class="flex flex-wrap justify-center gap-12">
2022-12-09 14:11:57 +01:00
{
projects.map((project) => (
2023-01-04 12:15:08 +01:00
<section class="bg-gray flex min-h-max w-80 flex-col rounded-md border-[1px] border-neutral-800 p-6 md:w-96">
2022-12-18 20:23:55 +01:00
<div class="flex">
2023-01-04 12:15:08 +01:00
<h2 class="mb-4 break-words text-3xl font-bold text-white">
2022-12-18 20:23:55 +01:00
{project.name}
</h2>
2023-01-04 12:15:08 +01:00
<div class="ml-4 flex h-fit translate-y-1 items-center justify-center gap-2 rounded-lg bg-neutral-800 py-1 px-4 text-neutral-300">
2022-12-18 20:23:55 +01:00
<div class="flex gap-1">
<img
src="/icons/star.svg"
alt=""
2023-01-04 12:15:08 +01:00
class="h-[21px] w-[21px] translate-y-[1px]"
2022-12-18 20:23:55 +01:00
/>
<p>{project.stats!.stars}</p>
2022-12-18 20:23:55 +01:00
</div>
<div class="flex gap-1">
{" "}
<img
src="/icons/code-fork-solid.svg"
alt=""
2023-01-04 12:15:08 +01:00
class="h-[21px] w-[21px] translate-y-[1px]"
2022-12-18 20:23:55 +01:00
/>
<p>{project.stats!.forks}</p>
2022-12-18 20:23:55 +01:00
</div>
</div>
</div>
2023-01-04 12:15:08 +01:00
<p class="mb-6 break-all text-neutral-300">
2022-12-09 16:39:55 +01:00
{project.desc}
</p>
2022-12-12 17:19:10 +01:00
<div>
<a
href={project.link}
2023-01-04 12:15:08 +01:00
class="bottom-0 inline-flex w-fit rounded-md bg-neutral-800 py-2 px-6 text-neutral-300 transition-colors duration-100 hover:bg-neutral-700 [&_img]:transition-all [&_img]:hover:translate-x-[2px]"
2022-12-12 17:19:10 +01:00
>
GitHub{" "}
<img
src="/icons/arrow-up-right.svg"
class="ml-2 mt-[1px] h-[23px] w-5"
2022-12-12 17:19:10 +01:00
alt=""
/>
</a>
<a
href={project.link}
2023-01-04 12:15:08 +01:00
class=" bottom-0 inline-flex w-fit translate-y-[6px] py-2 px-6 text-neutral-300 transition-all duration-100 hover:-translate-y-[-4px] hover:text-neutral-200"
2022-12-12 17:19:10 +01:00
>
<img
src="/icons/book-open.svg"
class="mr-2 h-6 w-5"
2022-12-12 17:19:10 +01:00
alt=""
/>
Docs{" "}
</a>
</div>
2022-12-09 14:11:57 +01:00
</section>
))
}
2022-12-09 13:26:17 +01:00
</main>
</Container>
2022-12-08 16:52:33 +01:00
</Layout>