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
2023-01-01 13:51:10 +01:00
interface Project {
2023-02-25 11:01:29 +01:00
name: string;
link: string;
desc: string;
stats?: {
forks: number;
stars: number;
};
2023-01-01 13:51:10 +01:00
}
const projects: Project[] = [
2023-02-25 11:01:29 +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.",
},
{
name: "HyX",
link: "https://github.com/xHyroM/HyX",
desc: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque, quaerat.",
},
{
name: "Mashe",
link: "https://github.com/xHyroM/mashe",
desc: "Simple, fast, and easy to use Event Handling for Java.",
},
{
name: "Mumblum",
link: "https://github.com/xHyroM/mumblum",
desc: "Mumblum is a simple, modern discord bot in JDA.",
},
{
name: "setup-bun",
2023-04-08 13:30:01 +02:00
link: "https://github.com/oven-sh/setup-bun",
2023-02-25 11:01:29 +01:00
desc: "Set up your GitHub Actions workflow with a specific version of Bun.",
},
{
name: "Roles Bot",
link: "https://github.com/xHyroM/roles-bot",
desc: 'Discord bot for "button" roles, using Cloudflare Workers.',
},
{
name: "Bun Discord Bot",
link: "https://github.com/xHyroM/bun-discord-bot",
desc: "Official serverless discord bot for bun discord server.",
},
{
name: "hykord",
link: "https://github.com/xHyroM/hykord",
desc: "My @discord client modification.",
},
{
name: "frog",
link: "https://github.com/xHyroM/frog",
desc: "Frog is an extremely simple language based on the monkey language.",
},
2023-03-27 18:41:59 +02:00
{
name: "lsx",
link: "https://github.com/xHyroM/lsx",
desc: "Lsx is a simple, fast, and easy to use ls implementation in Rust.",
},
{
name: "Slovensko v Grafoch",
link: "https://github.com/xHyroM/slovensko-v-grafoch",
desc: "Slovensko v Grafoch is a website that shows data about Slovakia in graphs.",
},
{
name: "Peddler's Pocket",
link: "https://github.com/xHyroM/peddlerspocket",
2023-04-29 15:46:50 +02:00
desc: "/sell command that allows you to put things into GUI and then sell them by closing",
2023-03-27 18:41:59 +02:00
},
{
name: "Peak Pursuit",
link: "https://github.com/xHyroM/peakpursuit",
2023-04-29 15:46:50 +02:00
desc: "PeakPursuit is a plugin for King of the Hill events that adds a competitive edge to your server gameplay. Conquer the hill and claim the crown!",
2023-04-02 18:38:30 +02:00
},
{
name: "Spawner Genz",
link: "https://github.com/xHyroM/spawnergenz",
2023-04-29 15:46:50 +02:00
desc: "Spawner Genz is a plugin that modifies the functionality of spawners so that they don't spawn entities, but instead store drops in a virtual storag in which you can then sell or move everything to your inventory.",
2023-03-27 18:41:59 +02:00
},
2022-12-09 14:11:57 +01:00
];
2023-01-01 13:51:10 +01:00
for (const project of projects) {
2023-04-08 13:20:27 +02:00
try {
2023-04-08 13:30:01 +02:00
const rawRepository = await fetch(
`https://api.github.com/repos/${project.link.slice(19)}`,
{
2023-04-08 13:20:27 +02:00
headers: {
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
},
2023-04-08 13:30:01 +02:00
}
).catch(console.log);
if (!rawRepository) {
project.stats = {
forks: 0,
stars: 0,
};
continue;
}
2023-01-01 13:51:10 +01:00
2023-04-08 13:30:01 +02:00
const repository = await rawRepository.json();
2023-04-08 13:12:39 +02:00
2023-04-08 13:20:27 +02:00
project.stats = {
forks: repository.forks,
stars: repository.stargazers_count,
};
} catch (e) {
console.log(e);
}
2023-01-01 13:51:10 +01:00
}
2023-03-27 18:41:59 +02:00
2023-04-01 10:28:22 +02:00
projects.sort((a, b) => a.name.localeCompare(b.name));
2022-12-08 16:52:33 +01:00
---
2023-02-25 11:01:29 +01:00
<Layout
schemaOrg={{
"@context": "https://schema.org/",
"@type": "ItemList",
2023-02-25 12:19:12 +01:00
name: "Projects",
2023-02-25 11:01:29 +01:00
itemListElement: projects.map((project, i) => ({
"@type": "ListItem",
position: i + 1,
name: project.name,
url: project.link,
})),
}}
>
<Navbar />
<h1 class="w-full py-32 text-center text-5xl font-extrabold text-white">
Projects
</h1>
2022-12-08 16:52:33 +01:00
2023-05-14 11:36:13 +02:00
<Container class="pb-4">
2023-02-25 11:01:29 +01:00
<main class="flex flex-wrap justify-center gap-12">
{
projects.map((project) => (
2023-05-14 11:36:13 +02:00
<section class="flex min-h-max w-80 flex-col justify-between rounded-md border-[1px] border-neutral-800 bg-gray p-6 md:w-96">
2023-02-25 11:01:29 +01:00
<div class="flex">
<h2 class="mb-4 break-words text-3xl font-bold text-white">
{project.name}
</h2>
2023-05-14 11:36:13 +02:00
<div class="ml-4 flex h-fit translate-y-1 items-center justify-center gap-2 rounded-lg bg-neutral-800 px-4 py-1 text-neutral-300">
2023-02-25 11:01:29 +01:00
<div class="flex gap-1">
<img
src="/icons/star.svg"
alt=""
class="h-[21px] w-[21px] translate-y-[1px]"
/>
<p>{project.stats!.stars}</p>
</div>
<div class="flex gap-1">
{" "}
<img
src="/icons/code-fork-solid.svg"
alt=""
class="h-[21px] w-[21px] translate-y-[1px]"
/>
<p>{project.stats!.forks}</p>
</div>
</div>
</div>
2022-12-18 20:23:55 +01:00
2023-02-25 11:01:29 +01:00
<p class="mb-6 break-all text-neutral-300">{project.desc}</p>
<div>
<a
href={project.link}
2023-05-14 11:36:13 +02:00
class="bottom-0 inline-flex w-fit rounded-md bg-neutral-800 px-6 py-2 text-neutral-300 transition-colors duration-100 hover:bg-neutral-700 [&_img]:transition-all [&_img]:hover:translate-x-[2px]"
2023-02-25 11:01:29 +01:00
>
GitHub{" "}
<img
src="/icons/arrow-up-right.svg"
class="ml-2 mt-[1px] h-[23px] w-5"
alt=""
/>
</a>
<a
href={project.link}
2023-05-14 11:36:13 +02:00
class=" bottom-0 inline-flex w-fit translate-y-[6px] px-6 py-2 text-neutral-300 transition-all duration-100 hover:-translate-y-[-4px] hover:text-neutral-200"
2023-02-25 11:01:29 +01:00
>
<img src="/icons/book-open.svg" class="mr-2 h-6 w-5" alt="" />
Docs{" "}
</a>
</div>
</section>
))
}
</main>
</Container>
2022-12-08 16:52:33 +01:00
</Layout>