From 6f0395798a1196d0450a90dfea81c8844ccddb4b Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Sat, 13 Mar 2021 01:32:41 +0100 Subject: [PATCH] feat(ui): minor fixes --- view/public/global.css | 8 +++++++- view/src/components/Analyzer.svelte | 2 +- view/src/components/Editor/Editor.svelte | 2 +- view/src/components/Editor/OrbView.ts | 7 ++++--- view/src/components/Editor/Painter.svelte | 11 ++++++----- view/src/icons/Cross.svelte | 15 +++++++++++---- view/src/icons/Plus.svelte | 21 +++++++++++++++++++++ view/src/icons/index.ts | 3 ++- view/src/routes/list.svelte | 17 ++++++++++------- view/src/routes/main.svelte | 5 +++++ 10 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 view/src/icons/Plus.svelte diff --git a/view/public/global.css b/view/public/global.css index 6867ff9..684e505 100755 --- a/view/public/global.css +++ b/view/public/global.css @@ -37,6 +37,13 @@ input, button, select, textarea { box-sizing: border-box; border: 1px solid #ccc; border-radius: 2px; + background-color: #000000; + outline: none; + color: white; + cursor: pointer; + border: none; + padding: 4px 9px; + border-radius: 0px; } input:disabled { @@ -44,7 +51,6 @@ input:disabled { } button { - background-color: #f4f4f4; outline: none; cursor: pointer; } diff --git a/view/src/components/Analyzer.svelte b/view/src/components/Analyzer.svelte index 574e3a3..a046da6 100644 --- a/view/src/components/Analyzer.svelte +++ b/view/src/components/Analyzer.svelte @@ -44,7 +44,7 @@ ) / 100}%

{ - hasConfirmed = c; + hasConfirmed = c === true; }) if (shouldBeRendering) return; diff --git a/view/src/components/Editor/Painter.svelte b/view/src/components/Editor/Painter.svelte index 66bc2eb..a012829 100644 --- a/view/src/components/Editor/Painter.svelte +++ b/view/src/components/Editor/Painter.svelte @@ -111,8 +111,6 @@ cx.arc(x, y, brushRadius * wrapperHeightRatio, 0, 2 * Math.PI); cx.fill(); cx.closePath(); - - orb.updateOverlay(); } let polygonPoints = []; @@ -158,7 +156,12 @@ e.preventDefault(); mode = mode === "2d" ? "3d" : "2d"; - orb.updateOverlay(); + + if (mode === "3d") { + if (!orb) orb = OrbView(image, cx1, canvas3D); + orb.updateOverlay(); + } + mode === "2d" ? orb.stop() : orb.start(); } @@ -323,8 +326,6 @@ handleResize(); - orb = OrbView(image, cx1, canvas3D); - setTimeout(() => handleResize(), 500); setTimeout(() => handleResize(), 2000); }); diff --git a/view/src/icons/Cross.svelte b/view/src/icons/Cross.svelte index 68cadcd..17cf907 100644 --- a/view/src/icons/Cross.svelte +++ b/view/src/icons/Cross.svelte @@ -1,6 +1,12 @@ + + diff --git a/view/src/icons/Plus.svelte b/view/src/icons/Plus.svelte new file mode 100644 index 0000000..17cf907 --- /dev/null +++ b/view/src/icons/Plus.svelte @@ -0,0 +1,21 @@ + + + + + diff --git a/view/src/icons/index.ts b/view/src/icons/index.ts index 85177f9..3e87783 100644 --- a/view/src/icons/index.ts +++ b/view/src/icons/index.ts @@ -1 +1,2 @@ -export { default as Cross } from "./Cross.svelte" \ No newline at end of file +export { default as Cross } from "./Cross.svelte" +export { default as Plus } from "./Plus.svelte" \ No newline at end of file diff --git a/view/src/routes/list.svelte b/view/src/routes/list.svelte index 79fd4b2..047485e 100644 --- a/view/src/routes/list.svelte +++ b/view/src/routes/list.svelte @@ -95,30 +95,33 @@ {/each}
route.set("main")}> - +

Add more images