From d85a35ca0e8bae68a6f492024c26172fcdce15a2 Mon Sep 17 00:00:00 2001 From: Jeannie McGill Date: Wed, 9 Aug 2023 21:34:18 -0400 Subject: [PATCH 01/33] Add close button for category dropdown --- src/lib/foundation/Chooser.svelte | 20 +++++++++++++++++++- src/lib/icons/close.svg | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/lib/icons/close.svg diff --git a/src/lib/foundation/Chooser.svelte b/src/lib/foundation/Chooser.svelte index 36473fe..f488ba6 100644 --- a/src/lib/foundation/Chooser.svelte +++ b/src/lib/foundation/Chooser.svelte @@ -2,6 +2,7 @@ import { createEventDispatcher } from "svelte"; import { t, locale } from "$lib/language/translate"; import { defaultFilterCategory } from "../filters"; + import CloseIcon from "$lib/icons/close.svg"; export let options = []; @@ -33,7 +34,13 @@ {isEnglish ? chosenOption : $t(chosenOption)}
-
{$t('Chooser.CategoryPrompt')}
+
+
{$t('Chooser.CategoryPrompt')} + +
+
{#each options as option} @@ -45,4 +52,15 @@ .dropdownHidden { @apply hidden; } + .chooser-text{ + text-align: left; + display: flex; + } + .close-button{ + margin-left: auto; + } + .icon { + width: 30px; + height: 30px; + } \ No newline at end of file diff --git a/src/lib/icons/close.svg b/src/lib/icons/close.svg new file mode 100644 index 0000000..e9ec00d --- /dev/null +++ b/src/lib/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file From cdb3ad90fb27423dbb483d56c67f854324e8b66c Mon Sep 17 00:00:00 2001 From: Jeannie McGill Date: Sat, 12 Aug 2023 11:38:10 -0400 Subject: [PATCH 02/33] Pull dev, use x-mark, and tailwind --- src/lib/foundation/Chooser.svelte | 19 ++++--------------- src/lib/icons/close.svg | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 src/lib/icons/close.svg diff --git a/src/lib/foundation/Chooser.svelte b/src/lib/foundation/Chooser.svelte index f488ba6..b1715e4 100644 --- a/src/lib/foundation/Chooser.svelte +++ b/src/lib/foundation/Chooser.svelte @@ -2,7 +2,7 @@ import { createEventDispatcher } from "svelte"; import { t, locale } from "$lib/language/translate"; import { defaultFilterCategory } from "../filters"; - import CloseIcon from "$lib/icons/close.svg"; + import CloseIcon from "$lib/icons/x-mark.svg"; export let options = []; @@ -35,9 +35,9 @@
-
{$t('Chooser.CategoryPrompt')} -
@@ -52,15 +52,4 @@ .dropdownHidden { @apply hidden; } - .chooser-text{ - text-align: left; - display: flex; - } - .close-button{ - margin-left: auto; - } - .icon { - width: 30px; - height: 30px; - } \ No newline at end of file diff --git a/src/lib/icons/close.svg b/src/lib/icons/close.svg deleted file mode 100644 index e9ec00d..0000000 --- a/src/lib/icons/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From c54fb9b9f7566f18f7ff112ba97533b125dfa163 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Sat, 12 Aug 2023 12:48:59 -0400 Subject: [PATCH 03/33] Move catalog page state into stores --- src/lib/stores/catalog.ts | 8 +++ src/routes/+page.svelte | 137 ++++++++++++++++++-------------------- 2 files changed, 73 insertions(+), 72 deletions(-) create mode 100644 src/lib/stores/catalog.ts diff --git a/src/lib/stores/catalog.ts b/src/lib/stores/catalog.ts new file mode 100644 index 0000000..68083fa --- /dev/null +++ b/src/lib/stores/catalog.ts @@ -0,0 +1,8 @@ +import { defaultFilterCategory } from "$lib/filters"; +import { writable } from "svelte/store"; + +export const categoryFilter = writable(defaultFilterCategory); + +export const searchFilter = writable(''); + +export const wishListFilter = writable(false); \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ef27fd9..6f6d3e5 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,82 +1,75 @@
- {#if !data} - - {:else} - -
-
- - {#key showingOnlyWishList} - - {/key} -
- -
-
- {#if shownThings.length > 0} - - {:else} -
{$t("No Results")}
- {/if} -
- {/if} -
\ No newline at end of file + {#if !data} + + {:else} + +
+
+ + {#key $wishListFilter} + + {/key} +
+ +
+
+ {#if shownThings.length > 0} + + {:else} +
{$t('No Results')}
+ {/if} +
+ {/if} +
From f58356e143fbb12bfcbeb8fbf8cb58f6590c79fb Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Sat, 12 Aug 2023 13:14:58 -0400 Subject: [PATCH 04/33] Refactor catalog page using stores and ThingsView --- src/lib/stores/catalog.ts | 8 +++++++- src/lib/views/ThingsView.svelte | 6 ++++++ src/routes/+page.svelte | 16 +++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 src/lib/views/ThingsView.svelte diff --git a/src/lib/stores/catalog.ts b/src/lib/stores/catalog.ts index 68083fa..fdf3229 100644 --- a/src/lib/stores/catalog.ts +++ b/src/lib/stores/catalog.ts @@ -5,4 +5,10 @@ export const categoryFilter = writable(defaultFilterCategory); export const searchFilter = writable(''); -export const wishListFilter = writable(false); \ No newline at end of file +export const wishListFilter = writable(false); + +export const things = writable<[]>(undefined); + +export const filteredThings = writable<[]>(undefined); + +export const categories = writable<[]>(undefined); \ No newline at end of file diff --git a/src/lib/views/ThingsView.svelte b/src/lib/views/ThingsView.svelte new file mode 100644 index 0000000..3f4b106 --- /dev/null +++ b/src/lib/views/ThingsView.svelte @@ -0,0 +1,6 @@ + + + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 6f6d3e5..08e422a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1,6 @@ + +{#key $wishListFilter} + +{/key} \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 08e422a..7abb8af 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,16 +1,14 @@ @@ -51,7 +38,7 @@
- +
{#if $filteredThings.length > 0} From da9f7eea8aa8a779c120e57cbc8c410b87190fdf Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Sun, 13 Aug 2023 05:52:27 -0400 Subject: [PATCH 07/33] Refactor foundation exports --- src/lib/Foundation.svelte | 7 ------- src/lib/{ => foundation}/LoadingIndicator.svelte | 2 +- src/lib/foundation/index.ts | 7 +++++++ src/lib/layout/Footer.svelte | 2 +- src/lib/views/WishListButtonView.svelte | 3 +-- src/routes/+page.svelte | 4 +--- 6 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 src/lib/Foundation.svelte rename src/lib/{ => foundation}/LoadingIndicator.svelte (85%) create mode 100644 src/lib/foundation/index.ts diff --git a/src/lib/Foundation.svelte b/src/lib/Foundation.svelte deleted file mode 100644 index e66d0bb..0000000 --- a/src/lib/Foundation.svelte +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/src/lib/LoadingIndicator.svelte b/src/lib/foundation/LoadingIndicator.svelte similarity index 85% rename from src/lib/LoadingIndicator.svelte rename to src/lib/foundation/LoadingIndicator.svelte index 533380a..f2cc2c0 100644 --- a/src/lib/LoadingIndicator.svelte +++ b/src/lib/foundation/LoadingIndicator.svelte @@ -1,5 +1,5 @@
diff --git a/src/lib/foundation/index.ts b/src/lib/foundation/index.ts new file mode 100644 index 0000000..0073daa --- /dev/null +++ b/src/lib/foundation/index.ts @@ -0,0 +1,7 @@ +export { default as Button } from "./Button.svelte"; +export { default as Chooser } from "./Chooser.svelte"; +export { default as Column } from "./Column.svelte"; +export { default as LoadingIndicator } from "./LoadingIndicator.svelte"; +export { default as Row } from "./Row.svelte"; +export { default as TextInput } from "./TextInput.svelte"; +export { default as Title } from "./Title.svelte"; \ No newline at end of file diff --git a/src/lib/layout/Footer.svelte b/src/lib/layout/Footer.svelte index f7a36bf..a513d22 100644 --- a/src/lib/layout/Footer.svelte +++ b/src/lib/layout/Footer.svelte @@ -1,5 +1,5 @@
diff --git a/src/lib/views/WishListButtonView.svelte b/src/lib/views/WishListButtonView.svelte index ab94c51..23e580c 100644 --- a/src/lib/views/WishListButtonView.svelte +++ b/src/lib/views/WishListButtonView.svelte @@ -1,11 +1,10 @@ {#key $wishListFilter} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c5e65ad..43ae90d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,8 +1,6 @@ From 78e5139188f315f8786d35aebbbd71ac1852c588 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Sun, 13 Aug 2023 05:58:37 -0400 Subject: [PATCH 09/33] Move layout into foundation --- src/lib/{ => foundation}/layout/Footer.svelte | 0 src/lib/{ => foundation}/layout/Header.svelte | 0 src/lib/{ => foundation}/layout/Layout.svelte | 0 src/routes/+layout.svelte | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename src/lib/{ => foundation}/layout/Footer.svelte (100%) rename src/lib/{ => foundation}/layout/Header.svelte (100%) rename src/lib/{ => foundation}/layout/Layout.svelte (100%) diff --git a/src/lib/layout/Footer.svelte b/src/lib/foundation/layout/Footer.svelte similarity index 100% rename from src/lib/layout/Footer.svelte rename to src/lib/foundation/layout/Footer.svelte diff --git a/src/lib/layout/Header.svelte b/src/lib/foundation/layout/Header.svelte similarity index 100% rename from src/lib/layout/Header.svelte rename to src/lib/foundation/layout/Header.svelte diff --git a/src/lib/layout/Layout.svelte b/src/lib/foundation/layout/Layout.svelte similarity index 100% rename from src/lib/layout/Layout.svelte rename to src/lib/foundation/layout/Layout.svelte diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8066e24..fe9c096 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,7 +1,7 @@ Date: Sun, 13 Aug 2023 06:02:12 -0400 Subject: [PATCH 10/33] Move utils into folder --- src/lib/foundation/Chooser.svelte | 2 +- src/lib/stores/catalog.ts | 2 +- src/lib/things/Things.svelte | 2 +- src/lib/{ => utils}/filters.ts | 0 src/lib/{ => utils}/shuffle.ts | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename src/lib/{ => utils}/filters.ts (100%) rename src/lib/{ => utils}/shuffle.ts (100%) diff --git a/src/lib/foundation/Chooser.svelte b/src/lib/foundation/Chooser.svelte index 36473fe..d01a956 100644 --- a/src/lib/foundation/Chooser.svelte +++ b/src/lib/foundation/Chooser.svelte @@ -1,7 +1,7 @@ {#key $wishListFilter} -
-
-
{$t('Chooser.CategoryPrompt')} - -
-
- - {#each options as option} - - {/each} -
+ +
+
+
+ {$t('Chooser.CategoryPrompt')} + +
+
+ + {#each options as option} + + {/each} +
\ No newline at end of file + .dropdownHidden { + @apply hidden; + } + From bf0394d4cbe9746948b057302d718c5558501a3d Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Mon, 14 Aug 2023 19:46:24 -0400 Subject: [PATCH 18/33] Pull out ChooserItem, restyle Chooser --- src/lib/components/Chooser.svelte | 32 ++++++++----------- src/lib/components/Chooser/ChooserItem.svelte | 7 ++++ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 src/lib/components/Chooser/ChooserItem.svelte diff --git a/src/lib/components/Chooser.svelte b/src/lib/components/Chooser.svelte index 903bfae..b0d09c9 100644 --- a/src/lib/components/Chooser.svelte +++ b/src/lib/components/Chooser.svelte @@ -1,12 +1,12 @@ + +
+
+
+ {title} + +
+
+
+
+ {#each options as option} + onOptionClick(option)}>{option} +
+ {/each} +
+
+ + \ No newline at end of file From 53ebdf660ce72684f9080d382ccd5706b0f1bbb8 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Mon, 14 Aug 2023 19:58:57 -0400 Subject: [PATCH 20/33] Add Category title translation --- src/lib/components/Chooser.svelte | 4 ++-- src/lib/language/translations.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/Chooser.svelte b/src/lib/components/Chooser.svelte index 6954bdd..7999cf0 100644 --- a/src/lib/components/Chooser.svelte +++ b/src/lib/components/Chooser.svelte @@ -50,8 +50,8 @@
+ + \ No newline at end of file From 12f720f0bba072e23b04482b8a09582c9ecf1abb Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Mon, 14 Aug 2023 20:31:20 -0400 Subject: [PATCH 22/33] Combine Chooser button and body when open --- src/app.css | 1 + src/lib/components/Chooser.svelte | 5 ++-- src/lib/components/Chooser/ChooserBody.svelte | 26 +++++++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/app.css b/src/app.css index 122c8d9..57f9aae 100644 --- a/src/app.css +++ b/src/app.css @@ -19,6 +19,7 @@ -webkit-box-shadow: 2px 2px 0px 0px #000000; } + .hovers-above, .hovers:focus, .hovers:hover { box-shadow: 3px 3px 0 #000000; diff --git a/src/lib/components/Chooser.svelte b/src/lib/components/Chooser.svelte index 82d1d9c..c516a52 100644 --- a/src/lib/components/Chooser.svelte +++ b/src/lib/components/Chooser.svelte @@ -28,9 +28,7 @@
{}} on:keypress={() => {}}>
{#each options as option} - onOptionClick(option)}>{option}
+ onOptionClick(option)}>{option} {/each}
From 9943dbdb9225277f2fc0ca77bf91ca5656f10590 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Mon, 14 Aug 2023 21:29:43 -0400 Subject: [PATCH 23/33] Indicate selected option with check icon --- src/lib/components/Chooser.svelte | 2 +- src/lib/components/Chooser/ChooserBody.svelte | 7 ++++++- src/lib/components/Chooser/ChooserItem.svelte | 12 +++++++++++- src/lib/icons/check.svg | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/lib/icons/check.svg diff --git a/src/lib/components/Chooser.svelte b/src/lib/components/Chooser.svelte index c516a52..815ed20 100644 --- a/src/lib/components/Chooser.svelte +++ b/src/lib/components/Chooser.svelte @@ -28,7 +28,7 @@
{}} on:keypress={() => {}}>
diff --git a/src/lib/components/Chooser/ChooserItem.svelte b/src/lib/components/Chooser/ChooserItem.svelte index 71f703f..a2411f4 100644 --- a/src/lib/components/Chooser/ChooserItem.svelte +++ b/src/lib/components/Chooser/ChooserItem.svelte @@ -1,7 +1,17 @@ + + \ No newline at end of file diff --git a/src/lib/icons/check.svg b/src/lib/icons/check.svg new file mode 100644 index 0000000..66c0f29 --- /dev/null +++ b/src/lib/icons/check.svg @@ -0,0 +1,3 @@ + + + From 208f455797ac375ff7c15136de8cff730c16cd8a Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Mon, 14 Aug 2023 21:32:23 -0400 Subject: [PATCH 24/33] Move Chooser to folder --- src/lib/components/{ => Chooser}/Chooser.svelte | 2 +- src/lib/components/Chooser/index.ts | 1 + src/lib/components/index.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename src/lib/components/{ => Chooser}/Chooser.svelte (96%) create mode 100644 src/lib/components/Chooser/index.ts diff --git a/src/lib/components/Chooser.svelte b/src/lib/components/Chooser/Chooser.svelte similarity index 96% rename from src/lib/components/Chooser.svelte rename to src/lib/components/Chooser/Chooser.svelte index 815ed20..317f495 100644 --- a/src/lib/components/Chooser.svelte +++ b/src/lib/components/Chooser/Chooser.svelte @@ -1,7 +1,7 @@ + + {#key $wishListFilter}