Skip to content

Commit

Permalink
feat: UI tweaks (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 authored Oct 26, 2023
1 parent 73ebd74 commit 46cfa7a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 34 deletions.
12 changes: 8 additions & 4 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ path {
flex: 0 0 var(--panel-width);
width: var(--panel-width);
background-color: white;
overflow-y: scroll;
overflow-y: auto;

box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.2);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ path {

.section-header {
margin-bottom: 1rem;
padding: 1rem 0;
padding: 0.5rem 0;
border-bottom: 1px solid var(--purple-light);
font-size: 18px;
font-weight: 900;
Expand All @@ -164,6 +164,11 @@ path {

/* INPUTS */

form {
display: grid;
grid-template-columns: 1fr 1fr;
}

label {
font-size: 10px;
text-align: center;
Expand Down Expand Up @@ -281,7 +286,6 @@ select[multiple]:focus option:checked {
.flex-checkbox {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0.5rem;
}

Expand Down Expand Up @@ -315,7 +319,7 @@ select[multiple]:focus option:checked {
}

.layer-select {
height: 50px;
height: 100px;
background-color: white;
border: 1px solid var(--purple);
color: var(--purple);
Expand Down
62 changes: 32 additions & 30 deletions src/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -855,40 +855,42 @@ function ResetToDefaultsButton() {
function PlanOptions({state}: {state: State}) {
const dispatch = useContext(DispatchContext);
return <div>
<label className="flex-checkbox" title="Re-order paths to minimize pen-up travel time">
<input
type="checkbox"
checked={state.planOptions.sortPaths}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {sortPaths: !!e.target.checked}})}
/>
sort paths
</label>
<label className="flex-checkbox" title="Re-scale and position the image to fit on the page">
<input
type="checkbox"
checked={state.planOptions.fitPage}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {fitPage: !!e.target.checked}})}
/>
fit page
</label>
{!state.planOptions.fitPage ?
<label className="flex-checkbox" title="Remove lines that fall outside the margins">
<form>
<label className="flex-checkbox" title="Re-order paths to minimize pen-up travel time">
<input
type="checkbox"
checked={state.planOptions.cropToMargins}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {cropToMargins: !!e.target.checked}})}
checked={state.planOptions.sortPaths}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {sortPaths: !!e.target.checked}})}
/>
crop to margins
sort paths
</label>
: null}
<label className="flex-checkbox" title="Split into layers according to group ID, instead of stroke">
<input
type="checkbox"
checked={state.planOptions.layerMode === 'group'}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {layerMode: e.target.checked ? 'group' : 'stroke'}})}
/>
layer by group
</label>
<label className="flex-checkbox" title="Split into layers according to group ID, instead of stroke">
<input
type="checkbox"
checked={state.planOptions.layerMode === 'group'}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {layerMode: e.target.checked ? 'group' : 'stroke'}})}
/>
layer by group
</label>
<label className="flex-checkbox" title="Re-scale and position the image to fit on the page">
<input
type="checkbox"
checked={state.planOptions.fitPage}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {fitPage: !!e.target.checked}})}
/>
fit page
</label>
{!state.planOptions.fitPage ?
<label className="flex-checkbox" title="Remove lines that fall outside the margins">
<input
type="checkbox"
checked={state.planOptions.cropToMargins}
onChange={(e) => dispatch({type: "SET_PLAN_OPTION", value: {cropToMargins: !!e.target.checked}})}
/>
crop to margins
</label>
: null}
</form>
<div className="horizontal-labels">

<label title="point-joining radius (mm)" >
Expand Down

0 comments on commit 46cfa7a

Please sign in to comment.