website/src/routes/instances.svelte

76 lines
1.4 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-08-08 10:50:03 +05:30
import instances from "$lib/Instances.json";
2022-08-07 19:05:50 +05:30
2022-08-08 10:50:03 +05:30
let groups = instances.reduce((curr, val) => {
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>
<h1>Our instances</h1>
2022-08-08 10:50:03 +05:30
<CardOuter>
<div class="container">
{#each groups as group}
<div class="container-inner">
<h2>{group.category}</h2>
<div class="items">
{#each group.values as item}
<a href={item.website}>
<CardInner
title={item.name}
description={item.description}
icon={item.icon}
2022-08-10 13:55:26 +05:30
>
<LinksOuter>
2022-08-12 16:45:39 +05:30
<Link
url={item.projectWebsite}
class="web"
2022-08-12 16:45:39 +05:30
>
2022-08-10 13:55:26 +05:30
<div class="projectWebsite">
2022-08-12 16:45:39 +05:30
<div class="i-fa6-solid:globe" />
<span>Project website</span>
2022-08-10 13:55:26 +05:30
</div>
</Link>
</LinksOuter>
</CardInner>
2022-08-08 10:50:03 +05:30
</a>
{/each}
</div>
</div>
{/each}
</div>
</CardOuter>
2022-08-07 19:05:50 +05:30
<style>
2022-08-08 10:50:03 +05:30
.container-inner,
.container {
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;
flex-flow: row wrap;
gap: 2rem;
}
2022-08-07 19:05:50 +05:30
2022-08-08 10:50:03 +05:30
a {
text-decoration: none;
color: var(--text);
}
2022-08-12 16:45:39 +05:30
2022-08-10 13:55:26 +05:30
.projectWebsite {
display: flex;
align-items: center;
gap: 4px;
font-size: medium;
}
2022-08-08 10:50:03 +05:30
</style>