bgg-ottawa-sell-club/src/routes/+page.svelte

69 lines
1.4 KiB
Svelte
Raw Normal View History

2024-02-04 22:08:21 +00:00
<article>
2024-02-09 17:49:22 +00:00
{#if $games.length == 0}
2024-02-04 19:55:08 +00:00
<div class="medium-height middle-align center-align">
<div class="center-align">
<progress class="circle"></progress>
<h5>gathering games...</h5>
</div>
</div>
2024-02-09 17:49:22 +00:00
{:else}
<GameList
games={$games}
sellers={$sellers}
on:toggle_game_visibility={({ detail }) =>
games.toggle_hidden(detail)} />
{/if}
2024-01-31 18:44:13 +00:00
</article>
2024-01-31 18:22:14 +00:00
2024-02-01 19:37:15 +00:00
<script>
2024-02-05 15:30:23 +00:00
import { getContext } from 'svelte';
2024-02-01 22:40:56 +00:00
import GameList from './GameList.svelte';
2024-01-31 18:22:14 +00:00
2024-02-05 15:30:23 +00:00
const games = getContext('games');
const sellers = getContext('sellers');
2024-01-31 18:22:14 +00:00
2024-02-01 20:27:38 +00:00
function pretty_date(date) {
if (!date) return '';
return date.replace(/T.*/, '');
}
2024-01-31 18:22:14 +00:00
</script>
2024-01-31 18:44:13 +00:00
2024-02-01 19:37:15 +00:00
<style>
2024-01-31 18:44:13 +00:00
p {
font-size: var(--font-size-10);
2024-02-01 15:48:49 +00:00
max-width: 60em;
text-align: justify;
2024-02-01 22:40:56 +00:00
margin-left: 3em;
margin-right: 3em;
2024-01-31 18:44:13 +00:00
}
a {
color: var(--primary);
text-decoration: underline;
}
2024-02-01 19:37:15 +00:00
.game-cell {
display: flex;
}
.game-cell > * {
display: block;
}
.game-desc {
flex: 1;
}
td {
font-size: var(--font-size-10);
}
2024-02-01 23:06:57 +00:00
@media screen and (max-width: 730px) {
h1 {
font-size: var(--font-size-12);
}
p {
font-size: inherit;
margin-left: 1em;
margin-right: 1em;
}
}
2024-01-31 18:44:13 +00:00
</style>