2022-08-07 19:05:50 +05:30
|
|
|
<script>
|
2022-08-08 10:50:03 +05:30
|
|
|
import { CardInner, CardOuter } from "$lib/Card";
|
|
|
|
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-08 10:50:29 +05:30
|
|
|
/>
|
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);
|
|
|
|
}
|
|
|
|
</style>
|