feat(ui): improve colors of input shape
This commit is contained in:
@@ -113,7 +113,7 @@ html.theme-light {
|
|||||||
--color-layer-0: var(--neutral-100);
|
--color-layer-0: var(--neutral-100);
|
||||||
--color-layer-1: var(--neutral-100);
|
--color-layer-1: var(--neutral-100);
|
||||||
--color-layer-2: var(--neutral-200);
|
--color-layer-2: var(--neutral-200);
|
||||||
--color-layer-3: var(--neutral-500);
|
--color-layer-3: var(--neutral-300);
|
||||||
--color-active: #000000;
|
--color-active: #000000;
|
||||||
--color-selected: #c65a19;
|
--color-selected: #c65a19;
|
||||||
--color-connection: #888;
|
--color-connection: #888;
|
||||||
|
|||||||
@@ -121,6 +121,11 @@
|
|||||||
let vx = (mouseDown[0] - ev.clientX) * (100 / svgRect.width);
|
let vx = (mouseDown[0] - ev.clientX) * (100 / svgRect.width);
|
||||||
let vy = (mouseDown[1] - ev.clientY) * (100 / svgRect.height);
|
let vy = (mouseDown[1] - ev.clientY) * (100 / svgRect.height);
|
||||||
|
|
||||||
|
if (ev.shiftKey) {
|
||||||
|
vx /= 10;
|
||||||
|
vy /= 10;
|
||||||
|
}
|
||||||
|
|
||||||
let x = downCirclePosition[0] + ((isMirroredEvent ? 1 : -1) * vx);
|
let x = downCirclePosition[0] + ((isMirroredEvent ? 1 : -1) * vx);
|
||||||
let y = downCirclePosition[1] - vy;
|
let y = downCirclePosition[1] - vy;
|
||||||
|
|
||||||
@@ -200,16 +205,17 @@
|
|||||||
onmousedown={handleMouseDown}
|
onmousedown={handleMouseDown}
|
||||||
>
|
>
|
||||||
<path d={pathD} style:fill="var(--color-layer-3)" style:opacity={0.3} />
|
<path d={pathD} style:fill="var(--color-layer-3)" style:opacity={0.3} />
|
||||||
<path d={pathD} fill="none" stroke="var(--color-layer-2)" />
|
<path d={pathD} fill="none" stroke="var(--color-layer-3)" />
|
||||||
{#if mirror}
|
{#if mirror}
|
||||||
{#each groupedPoints as p, i (i)}
|
{#each groupedPoints as p, i (i)}
|
||||||
{@const x = 100 - p[0]}
|
{@const x = 100 - p[0]}
|
||||||
{@const y = p[1]}
|
{@const y = p[1]}
|
||||||
<circle
|
<circle
|
||||||
|
class:active={isMirroredEvent && draggingIndex === i}
|
||||||
data-index={i}
|
data-index={i}
|
||||||
cx={x}
|
cx={x}
|
||||||
cy={y}
|
cy={y}
|
||||||
r={2}
|
r={3}
|
||||||
>
|
>
|
||||||
</circle>
|
</circle>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -217,10 +223,11 @@
|
|||||||
|
|
||||||
{#each groupedPoints as p, i (i)}
|
{#each groupedPoints as p, i (i)}
|
||||||
<circle
|
<circle
|
||||||
|
class:active={!isMirroredEvent && draggingIndex === i}
|
||||||
data-index={i}
|
data-index={i}
|
||||||
cx={p[0]}
|
cx={p[0]}
|
||||||
cy={p[1]}
|
cy={p[1]}
|
||||||
r={2}
|
r={3}
|
||||||
>
|
>
|
||||||
</circle>
|
</circle>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -231,6 +238,10 @@
|
|||||||
.wrapper {
|
.wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
|
background-color: var(--color-layer-2);
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
outline: solid thin var(--color-outline);
|
||||||
}
|
}
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -240,13 +251,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
circle {
|
circle {
|
||||||
fill: var(--color-layer-2);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
stroke: transparent;
|
stroke: transparent;
|
||||||
transition: stroke 0.2s ease;
|
transition: fill 0.2s ease;
|
||||||
stroke-width: 0.5px;
|
stroke-width: 1px;
|
||||||
}
|
|
||||||
circle:hover {
|
|
||||||
stroke: var(--color-layer-3);
|
stroke: var(--color-layer-3);
|
||||||
|
fill: var(--color-layer-2);
|
||||||
|
}
|
||||||
|
circle.active,
|
||||||
|
circle:hover {
|
||||||
|
fill: var(--color-layer-3);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
let selectValue = $state(0);
|
let selectValue = $state(0);
|
||||||
const d = $derived(options[selectValue]);
|
const d = $derived(options[selectValue]);
|
||||||
let checked = $state(false);
|
let checked = $state(false);
|
||||||
let mirrorShape = $state(false);
|
let mirrorShape = $state(true);
|
||||||
let detailsOpen = $state(false);
|
let detailsOpen = $state(false);
|
||||||
|
|
||||||
let points = $state([]);
|
let points = $state([]);
|
||||||
@@ -108,7 +108,9 @@
|
|||||||
</label>
|
</label>
|
||||||
<p>{JSON.stringify(points)}</p>
|
<p>{JSON.stringify(points)}</p>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
<div style:width="300px">
|
||||||
<InputShape bind:value={points} mirror={mirrorShape} />
|
<InputShape bind:value={points} mirror={mirrorShape} />
|
||||||
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title="Details" value={detailsOpen}>
|
<Section title="Details" value={detailsOpen}>
|
||||||
|
|||||||
Reference in New Issue
Block a user