feat(ui): minor fixes

This commit is contained in:
max_richter 2021-03-13 01:32:41 +01:00
parent dd2e476065
commit 6f0395798a
10 changed files with 68 additions and 23 deletions

View File

@ -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;
}

View File

@ -44,7 +44,7 @@
) / 100}%
</p>
<div
transition:scaleX={{ duration: 500, delay: i * 200 }}
in:scaleX={{ duration: 500, delay: i * 200 }}
class="bar"
style={`width: ${
(correctDistortion ? color.value : color.distortedValue) * 100

View File

@ -39,7 +39,7 @@
overflow: hidden;
display: grid;
height: 100%;
grid-template-columns: 50px 1fr;
grid-template-columns: 75px 1fr;
grid-template-rows: 30px 1fr 30px;
gap: 0px 0px;
grid-template-areas:

View File

@ -2,7 +2,6 @@ import { Renderer, Camera, Transform, Texture, Raycast, Sphere, Program, Mesh }
import { Orbit } from "./CustomOrbit"
import { bufToImageUrl } from "../../helpers";
import VertexShader from "./Orb.vert";
import FragmentShader from "./Orb.frag";
import Toast from "../Toast";
@ -21,7 +20,9 @@ export default (image: Image, canvas2D: CanvasRenderingContext2D, canvas3D: HTML
const controls = new Orbit(camera, {
enablePan: false,
enableZoom: false,
rotateSpeed: -0.1
rotateSpeed: -0.5,
ease: 0,
inertia: 0,
});
function resize() {
@ -107,7 +108,7 @@ export default (image: Image, canvas2D: CanvasRenderingContext2D, canvas3D: HTML
function start() {
!hasConfirmed && Toast.confirm("Drawing does not work correctly in 3D at the moment").then(c => {
hasConfirmed = c;
hasConfirmed = c === true;
})
if (shouldBeRendering) return;

View File

@ -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);
});

View File

@ -1,6 +1,12 @@
<script>
export let w = 80;
export let color = "black";
export let weight = 1;
</script>
<svg
width="82"
height="82"
width={w}
height={w}
viewBox="0 0 82 82"
fill="none"
style="height: 100%;"
@ -8,7 +14,8 @@
>
<path
d="M41 0V81.5M81.75 40.75L0.25 40.75"
stroke="black"
stroke-width="0.75px"
stroke={color}
vector-effect="non-scaling-stroke"
stroke-width="{weight}px"
/>
</svg>

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 375 B

View File

@ -0,0 +1,21 @@
<script>
export let w = 80;
export let color = "black";
export let weight = 1;
</script>
<svg
width={w}
height={w}
viewBox="0 0 82 82"
fill="none"
style="height: 100%;"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M41 0V81.5M81.75 40.75L0.25 40.75"
stroke={color}
vector-effect="non-scaling-stroke"
stroke-width="{weight}px"
/>
</svg>

View File

@ -1 +1,2 @@
export { default as Cross } from "./Cross.svelte"
export { default as Cross } from "./Cross.svelte"
export { default as Plus } from "./Plus.svelte"

View File

@ -95,30 +95,33 @@
{/each}
<div id="cross-wrapper" on:click={() => route.set("main")}>
<Cross />
<Cross w={20} color="white" weight={2} />
<p>Add more images</p>
</div>
</main>
<style>
#cross-wrapper {
margin-top: 40px;
margin-top: 10px;
display: flex;
align-items: center;
background-color: black;
padding: 10px;
width: fit-content;
cursor: pointer;
}
#cross-wrapper > p {
margin: 0;
color: white;
margin-left: 10px;
}
main {
height: 100%;
max-width: 640px;
margin: 0 auto;
}
@media (max-width: 640px) {
main {
max-width: none;
}
h4 {
margin: 10px 0px;
}
.list-item {

View File

@ -117,6 +117,11 @@
align-items: center;
padding: 20px;
outline: solid thin black;
cursor: pointer;
}
.inner-wrapper:hover {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
p {