From b9d0bfdacce89c92e304087b99191d9bd99ab92e Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Wed, 18 Oct 2023 18:58:12 -0400 Subject: [PATCH] Start adding 3D viewing --- package.json | 5 +- src/components/GenerationListItem.svelte | 21 ++++-- src/components/ModelViewer.svelte | 10 +++ src/components/Nav.svelte | 8 ++- src/routes/+layout.server.ts | 4 +- src/routes/+layout.svelte | 6 +- src/routes/+page.svelte | 7 +- yarn.lock | 92 ++++++++++++++++++++++++ 8 files changed, 134 insertions(+), 19 deletions(-) create mode 100644 src/components/ModelViewer.svelte diff --git a/package.json b/package.json index 5107a53..9ef133f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@playwright/test": "^1.28.1", "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/kit": "^1.20.4", + "@types/three": "^0.157.2", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "autoprefixer": "^10.4.16", @@ -37,6 +38,8 @@ }, "type": "module", "dependencies": { - "@kittycad/lib": "^0.0.44" + "@kittycad/lib": "^0.0.44", + "svelte-cubed": "^0.2.1", + "three": "^0.157.0" } } diff --git a/src/components/GenerationListItem.svelte b/src/components/GenerationListItem.svelte index 65f0d13..4908aa4 100644 --- a/src/components/GenerationListItem.svelte +++ b/src/components/GenerationListItem.svelte @@ -1,5 +1,6 @@ -
-    {JSON.stringify(data, null, 2)}
-
-View model -Download model +
+
+
+

Your Prompt

+

"{data.prompt}"

+
+
+ +
+
+ +
diff --git a/src/components/ModelViewer.svelte b/src/components/ModelViewer.svelte new file mode 100644 index 0000000..984f5f6 --- /dev/null +++ b/src/components/ModelViewer.svelte @@ -0,0 +1,10 @@ + + + + + + + diff --git a/src/components/Nav.svelte b/src/components/Nav.svelte index f30df3d..8ddba21 100644 --- a/src/components/Nav.svelte +++ b/src/components/Nav.svelte @@ -1,17 +1,19 @@