diff --git a/README.md b/README.md index f2a8c1c..09dbe96 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,11 @@ This is a site that lets you browse NES games by their cartridge art. You can al 4. Run `npm run preview` to run the prod build of the site 5. Run `npm run build` to build the dist (outputs to `/build`). +## Todo + +- [ ] Selecting a cartridge pops open a dialog that shows it's info and a link to its entry in nescartdb +- [ ] Add fade in/out animations for the cards + --- ## Resources diff --git a/package-lock.json b/package-lock.json index d1f0701..86d2f64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,8 @@ "dependencies": { "bits-ui": "^0.21.1", "clsx": "^2.1.0", + "lucide-svelte": "^0.363.0", + "mode-watcher": "^0.3.0", "tailwind-merge": "^2.2.2", "tailwind-variants": "^0.2.1" }, @@ -3123,6 +3125,14 @@ "node": ">=10" } }, + "node_modules/lucide-svelte": { + "version": "0.363.0", + "resolved": "https://registry.npmjs.org/lucide-svelte/-/lucide-svelte-0.363.0.tgz", + "integrity": "sha512-zpUBFtMEEOOjILgiDX48ijibUww3JUCLrMo5YDGX/De/m6I+vn+oWIGvdyZtuc8nz/P8xHW9vWLKzIWeMrRYbA==", + "peerDependencies": { + "svelte": "^3 || ^4 || ^5.0.0-next.42" + } + }, "node_modules/magic-string": { "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", @@ -3241,6 +3251,14 @@ "ufo": "^1.3.2" } }, + "node_modules/mode-watcher": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mode-watcher/-/mode-watcher-0.3.0.tgz", + "integrity": "sha512-k8jjuTx94HaaRKWO6JDf8wL761hFatrTIHJKl+E+3JWcnv+GnMBH062zcLsy0lbCI3n7RZxxHaWi66auFnUO4g==", + "peerDependencies": { + "svelte": "^4.0.0" + } + }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", diff --git a/package.json b/package.json index 451b0a1..791d8f0 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,8 @@ "dependencies": { "bits-ui": "^0.21.1", "clsx": "^2.1.0", + "lucide-svelte": "^0.363.0", + "mode-watcher": "^0.3.0", "tailwind-merge": "^2.2.2", "tailwind-variants": "^0.2.1" } diff --git a/src/lib/components/ui/dialog/dialog-content.svelte b/src/lib/components/ui/dialog/dialog-content.svelte new file mode 100644 index 0000000..9512ba8 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-content.svelte @@ -0,0 +1,36 @@ + + + + + + + + + Close + + + diff --git a/src/lib/components/ui/dialog/dialog-description.svelte b/src/lib/components/ui/dialog/dialog-description.svelte new file mode 100644 index 0000000..e1d796a --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-description.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/dialog/dialog-footer.svelte b/src/lib/components/ui/dialog/dialog-footer.svelte new file mode 100644 index 0000000..6f6e589 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-footer.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/src/lib/components/ui/dialog/dialog-header.svelte b/src/lib/components/ui/dialog/dialog-header.svelte new file mode 100644 index 0000000..fd6b8f0 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/src/lib/components/ui/dialog/dialog-overlay.svelte b/src/lib/components/ui/dialog/dialog-overlay.svelte new file mode 100644 index 0000000..aaf930a --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-overlay.svelte @@ -0,0 +1,21 @@ + + + diff --git a/src/lib/components/ui/dialog/dialog-portal.svelte b/src/lib/components/ui/dialog/dialog-portal.svelte new file mode 100644 index 0000000..eb5d0a5 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-portal.svelte @@ -0,0 +1,8 @@ + + + + + diff --git a/src/lib/components/ui/dialog/dialog-title.svelte b/src/lib/components/ui/dialog/dialog-title.svelte new file mode 100644 index 0000000..06574f3 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-title.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/dialog/index.ts b/src/lib/components/ui/dialog/index.ts new file mode 100644 index 0000000..639b50d --- /dev/null +++ b/src/lib/components/ui/dialog/index.ts @@ -0,0 +1,34 @@ +import { Dialog as DialogPrimitive } from "bits-ui"; + +const Root = DialogPrimitive.Root; +const Trigger = DialogPrimitive.Trigger; + +import Title from "./dialog-title.svelte"; +import Portal from "./dialog-portal.svelte"; +import Footer from "./dialog-footer.svelte"; +import Header from "./dialog-header.svelte"; +import Overlay from "./dialog-overlay.svelte"; +import Content from "./dialog-content.svelte"; +import Description from "./dialog-description.svelte"; + +export { + Root, + Title, + Portal, + Footer, + Header, + Trigger, + Overlay, + Content, + Description, + // + Root as Dialog, + Title as DialogTitle, + Portal as DialogPortal, + Footer as DialogFooter, + Header as DialogHeader, + Trigger as DialogTrigger, + Overlay as DialogOverlay, + Content as DialogContent, + Description as DialogDescription, +}; diff --git a/src/lib/components/ui/input/index.ts b/src/lib/components/ui/input/index.ts new file mode 100644 index 0000000..859f3b0 --- /dev/null +++ b/src/lib/components/ui/input/index.ts @@ -0,0 +1,27 @@ +import Root from "./input.svelte"; + +export type FormInputEvent = T & { + currentTarget: EventTarget & HTMLInputElement; +}; +export type InputEvents = { + blur: FormInputEvent; + change: FormInputEvent; + click: FormInputEvent; + focus: FormInputEvent; + focusin: FormInputEvent; + focusout: FormInputEvent; + keydown: FormInputEvent; + keypress: FormInputEvent; + keyup: FormInputEvent; + mouseover: FormInputEvent; + mouseenter: FormInputEvent; + mouseleave: FormInputEvent; + paste: FormInputEvent; + input: FormInputEvent; +}; + +export { + Root, + // + Root as Input, +}; diff --git a/src/lib/components/ui/input/input.svelte b/src/lib/components/ui/input/input.svelte new file mode 100644 index 0000000..9a2fe0f --- /dev/null +++ b/src/lib/components/ui/input/input.svelte @@ -0,0 +1,35 @@ + + + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8506804..e8eda25 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,7 +1,9 @@ + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5982b0a..3fab44a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,2 +1,106 @@ -

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

+ + +
+
+ + +
+
+ {#if isLoading} + + {#each Array(6) as _} + + +
+ +
+
+ + + + +
+ {/each} + {:else if filteredNesCarts.length === 0} +

+ No results found +

+ {:else} + {#each filteredNesCarts as nesCart, i} + + + + + +

+ {nesCart.title} +

+

+ {nesCart.catalogId} +

+
+
+ {/each} + {/if} +
+
diff --git a/static/assets/nesCarts.json b/static/nesCarts.json similarity index 100% rename from static/assets/nesCarts.json rename to static/nesCarts.json