2022-01-28 05:27:12 +00:00
|
|
|
<script lang="ts">
|
2022-05-16 06:42:50 +00:00
|
|
|
// import { Checkbox, NumberInput } from 'carbon-components-svelte';
|
2022-07-12 00:00:32 +00:00
|
|
|
import Game from '$lib/components/game/index.svelte';
|
2022-04-25 01:00:27 +00:00
|
|
|
import type { GameType } from '$lib/types';
|
2022-07-10 06:34:01 +00:00
|
|
|
import Transition from '$lib/components/transition/index.svelte';
|
2022-05-16 06:42:50 +00:00
|
|
|
import Listbox from '$lib/components/listbox.svelte';
|
2022-07-08 22:16:30 +00:00
|
|
|
import Loading from '$lib/components/loading.svelte';
|
|
|
|
|
import Portal from '$lib/Portal.svelte';
|
2022-07-25 20:22:24 +00:00
|
|
|
import TextSearch from '$lib/components/search/textSearch/index.svelte';
|
|
|
|
|
import AdvancedSearch from '$lib/components/search/advancedSearch/index.svelte';
|
|
|
|
|
import RandomSearch from '$lib/components/search/random/index.svelte';
|
2022-07-13 01:27:08 +00:00
|
|
|
import { gameStore } from '$lib/stores/gameSearchStore';
|
2022-07-19 21:04:32 +00:00
|
|
|
import { boredState } from '$lib/stores/boredState';
|
2022-07-25 05:26:58 +00:00
|
|
|
import { Checkbox } from 'carbon-components-svelte';
|
2022-04-24 23:38:12 +00:00
|
|
|
// import { enhance } from "$lib/form";
|
|
|
|
|
|
2022-07-13 01:27:08 +00:00
|
|
|
// let games: GameType[] = [];
|
2022-01-28 05:27:12 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:head>
|
2022-07-07 19:30:14 +00:00
|
|
|
<title>Bored Game</title>
|
2022-01-28 05:27:12 +00:00
|
|
|
</svelte:head>
|
|
|
|
|
|
2022-04-24 23:38:12 +00:00
|
|
|
<h1>Search Boardgames!</h1>
|
|
|
|
|
<p>Input your requirements to search for board game that match your criteria</p>
|
|
|
|
|
<div class="game-form">
|
2022-07-25 20:22:24 +00:00
|
|
|
<TextSearch />
|
|
|
|
|
<AdvancedSearch />
|
|
|
|
|
<RandomSearch />
|
2022-04-24 23:38:12 +00:00
|
|
|
</div>
|
|
|
|
|
|
2022-07-19 21:04:32 +00:00
|
|
|
<!-- {#if submitting}
|
2022-07-08 22:16:30 +00:00
|
|
|
<Portal>
|
2022-07-10 06:34:01 +00:00
|
|
|
<Transition transition={{ type: 'fade', duration: 0 }}>
|
|
|
|
|
<div class="loading">
|
2022-07-08 22:16:30 +00:00
|
|
|
<Loading />
|
|
|
|
|
<h3>Loading...</h3>
|
2022-07-10 06:34:01 +00:00
|
|
|
</div>
|
|
|
|
|
</Transition>
|
2022-07-08 22:16:30 +00:00
|
|
|
<div class="background" />
|
|
|
|
|
</Portal>
|
2022-07-19 21:04:32 +00:00
|
|
|
{/if} -->
|
2022-07-08 22:16:30 +00:00
|
|
|
|
2022-07-10 19:55:30 +00:00
|
|
|
<h1>Games</h1>
|
2022-04-24 23:38:12 +00:00
|
|
|
<div class="games">
|
2022-07-13 01:27:08 +00:00
|
|
|
{#each $gameStore as game}
|
2022-07-12 00:07:03 +00:00
|
|
|
<Game {game} />
|
2022-04-24 23:38:12 +00:00
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2022-07-08 22:16:30 +00:00
|
|
|
.loading {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
z-index: 101;
|
|
|
|
|
display: grid;
|
|
|
|
|
place-items: center;
|
|
|
|
|
gap: 1rem;
|
2022-07-08 22:55:33 +00:00
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
2022-07-08 22:16:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.background {
|
|
|
|
|
background: black;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
cursor: none;
|
|
|
|
|
inset: 0;
|
|
|
|
|
position: fixed;
|
|
|
|
|
z-index: 100;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-25 01:00:27 +00:00
|
|
|
h1 {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2022-04-24 23:38:12 +00:00
|
|
|
button {
|
2022-07-06 00:15:37 +00:00
|
|
|
border-radius: 10px;
|
|
|
|
|
margin: 0.5rem;
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
color: var(--clr-input-txt);
|
|
|
|
|
background-color: var(--color-btn-primary-active);
|
2022-04-24 23:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.games {
|
2022-07-10 19:51:44 +00:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
2022-04-24 23:38:12 +00:00
|
|
|
gap: 2rem;
|
2022-07-10 19:55:30 +00:00
|
|
|
|
2022-07-11 04:17:59 +00:00
|
|
|
@media (max-width: 800px) {
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 550px) {
|
2022-07-10 19:55:30 +00:00
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
2022-04-24 23:38:12 +00:00
|
|
|
}
|
2022-07-12 00:00:32 +00:00
|
|
|
.game-form {
|
|
|
|
|
margin: 1rem;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
box-shadow: var(--level-2);
|
|
|
|
|
background: rgba(0, 0, 0, 0.02);
|
|
|
|
|
border: 2px solid var(--clr-primary);
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-08 19:23:05 +00:00
|
|
|
.game-form fieldset {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
2022-04-24 23:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
2022-07-08 19:23:05 +00:00
|
|
|
.game-form label {
|
2022-04-24 23:38:12 +00:00
|
|
|
display: grid;
|
2022-07-08 19:23:05 +00:00
|
|
|
margin: 1rem;
|
2022-04-24 23:38:12 +00:00
|
|
|
}
|
2022-01-28 05:27:12 +00:00
|
|
|
</style>
|