2022-08-29 03:48:29 +00:00
|
|
|
<script lang="ts">
|
2024-07-07 06:12:36 +00:00
|
|
|
const { data } = $props();
|
2024-04-17 19:02:51 +00:00
|
|
|
let collections = data?.collections || [];
|
2022-08-29 03:48:29 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:head>
|
2024-04-17 19:02:51 +00:00
|
|
|
<title>Your Collections | Bored Game</title>
|
2022-08-29 03:48:29 +00:00
|
|
|
</svelte:head>
|
|
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
<h1>Your Collections</h1>
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
<div class="collections">
|
|
|
|
|
<div class="collection-list">
|
|
|
|
|
{#if collections.length === 0}
|
|
|
|
|
<h2>You have no collections</h2>
|
2022-10-27 03:49:58 +00:00
|
|
|
{:else}
|
2024-04-17 19:02:51 +00:00
|
|
|
{#each collections as collection}
|
|
|
|
|
<div class="collection grid gap-0.5">
|
|
|
|
|
<h2><a href="/collections/{collection.cuid}">{collection.name}</a></h2>
|
|
|
|
|
<h3>Created at: {new Date(collection.created_at).toLocaleString()}</h3>
|
|
|
|
|
</div>
|
2022-10-27 03:49:58 +00:00
|
|
|
{/each}
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2023-07-18 21:23:45 +00:00
|
|
|
</div>
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2023-06-16 06:28:49 +00:00
|
|
|
<style lang="postcss">
|
2022-10-27 03:49:58 +00:00
|
|
|
h1 {
|
2024-04-17 19:02:51 +00:00
|
|
|
margin: 1.5rem 0;
|
2022-10-27 03:49:58 +00:00
|
|
|
width: 100%;
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
.collections {
|
|
|
|
|
margin: 2rem 0;
|
2022-10-27 03:49:58 +00:00
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
.collection-list {
|
2022-10-27 03:49:58 +00:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
|
|
|
|
gap: 2rem;
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2022-10-27 03:49:58 +00:00
|
|
|
@media (max-width: 800px) {
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2022-10-27 03:49:58 +00:00
|
|
|
@media (max-width: 550px) {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
</style>
|