website/src/routes/instances/+page.svelte

74 lines
1.5 KiB
Svelte
Raw Normal View History

2022-08-07 19:05:50 +05:30
<script>
2022-08-10 13:55:26 +05:30
import { CardInner, CardOuter, LinksOuter, Link } from "$lib/Card";
2022-09-10 21:28:19 +05:30
import instances from "$lib/Instances.json";
2022-08-07 19:05:50 +05:30
2022-09-10 21:28:19 +05:30
let groups = instances.reduce((curr, val) => {
2022-08-08 10:50:03 +05:30
let group = curr.find((g) => g.category === `${val.category}`);
if (group) {
group.values.push(val);
} else {
curr.push({ category: `${val.category}`, values: [val] });
}
return curr;
}, []);
2022-08-07 19:05:50 +05:30
</script>
2022-08-24 21:37:30 +05:30
<svelte:head>
2022-09-10 21:28:19 +05:30
<title>Our instances | Project Segfault</title>
<meta name="description" content="Our collection of instances." />
2022-08-24 21:37:30 +05:30
</svelte:head>
2022-09-10 21:28:19 +05:30
<h1>Our instances</h1>
2022-08-08 10:50:03 +05:30
<CardOuter>
2022-08-27 22:07:37 +05:30
<div class="wrapper">
2022-08-08 10:50:03 +05:30
{#each groups as group}
2022-08-27 22:07:37 +05:30
<h2>{group.category}</h2>
<div class="items">
{#each group.values as item}
2022-08-31 16:46:12 +05:30
<CardInner
title={item.name}
description={item.description}
icon={item.icon}
>
<LinksOuter>
<Link url={item.website} class="web">
<div class="withText">
<div class="i-fa6-solid:globe" />
<span>Instance link</span>
</div>
</Link>
<Link url={item.projectWebsite} class="link">
<div class="withText">
<div class="i-fa6-solid:circle-info" />
<span>Project website</span>
</div>
</Link>
</LinksOuter>
</CardInner>
2022-08-27 22:07:37 +05:30
{/each}
2022-08-08 10:50:03 +05:30
</div>
{/each}
</div>
</CardOuter>
2022-08-07 19:05:50 +05:30
<style>
2022-08-27 22:07:37 +05:30
.wrapper {
2022-08-08 10:50:03 +05:30
display: flex;
flex-direction: column;
}
2022-08-07 19:05:50 +05:30
2022-08-08 10:50:03 +05:30
.items {
display: flex;
flex-direction: row;
2022-08-27 22:07:37 +05:30
flex-wrap: wrap;
2022-08-08 10:50:03 +05:30
gap: 2rem;
}
2022-08-07 19:05:50 +05:30
2022-08-27 22:07:37 +05:30
.withText {
2022-08-10 13:55:26 +05:30
display: flex;
align-items: center;
gap: 4px;
font-size: medium;
}
2022-08-08 10:50:03 +05:30
</style>