diff --git a/src/lib/components/search/advancedSearch/index.svelte b/src/lib/components/search/advancedSearch/index.svelte new file mode 100644 index 0000000..d270a7e --- /dev/null +++ b/src/lib/components/search/advancedSearch/index.svelte @@ -0,0 +1,102 @@ + + +
+
+
+ +
+
+ + +
+
+ + +
+
+ +
+ + diff --git a/src/lib/components/search/random/index.svelte b/src/lib/components/search/random/index.svelte new file mode 100644 index 0000000..0edae18 --- /dev/null +++ b/src/lib/components/search/random/index.svelte @@ -0,0 +1,54 @@ + + +
+
+ + +
+
+ + diff --git a/src/lib/components/search/textSearch/index.svelte b/src/lib/components/search/textSearch/index.svelte new file mode 100644 index 0000000..8b28fe8 --- /dev/null +++ b/src/lib/components/search/textSearch/index.svelte @@ -0,0 +1,57 @@ + + +
+
+
+ +
+
+ +
+ + diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 030f1aa..7f112a4 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -6,55 +6,15 @@ import Listbox from '$lib/components/listbox.svelte'; import Loading from '$lib/components/loading.svelte'; import Portal from '$lib/Portal.svelte'; + 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'; import { gameStore } from '$lib/stores/gameSearchStore'; import { boredState } from '$lib/stores/boredState'; import { Checkbox } from 'carbon-components-svelte'; // import { enhance } from "$lib/form"; // let games: GameType[] = []; - let submitting = $boredState?.loading; - - async function handleSubmit(event: SubmitEvent) { - // submitting = true; - boredState.set({ loading: true }); - const form = event.target as HTMLFormElement; - console.log('form', form); - const response = await fetch('/api/games', { - method: 'POST', - headers: { accept: 'application/json' }, - body: new FormData(form) - }); - const responseData = await response.json(); - // submitting = false; - boredState.set({ loading: false }); - gameStore.removeAll(); - gameStore.addAll(responseData?.games); - // games = responseData?.games; - } - - async function handleSearch(event: SubmitEvent) { - boredState.set({ loading: true }); - const form = event.target as HTMLFormElement; - console.log('form', form); - const response = await fetch('/api/game', { - method: 'POST', - headers: { accept: 'application/json' }, - body: new FormData(form) - }); - const responseData = await response.json(); - // submitting = false; - boredState.set({ loading: false }); - gameStore.removeAll(); - gameStore.addAll(responseData?.games); - } - - let name = ''; - let minAge = 0; - let minPlayers = 1; - let maxPlayers = 1; - let exactMinAge = false; - let exactMinPlayers = false; - let exactMaxPlayers = false; @@ -64,70 +24,9 @@

Search Boardgames!

Input your requirements to search for board game that match your criteria

-
-
-
- -
-
- -
-
-
-
- -
-
- - -
-
- - -
-
- -
-
-
- - -
-
+ + +