From a7b708363717c158a94b132bc487097a365afe29 Mon Sep 17 00:00:00 2001 From: DaPandamonium Date: Sat, 26 Jul 2025 01:12:48 +0300 Subject: [PATCH 1/6] style(RecipePanel): adjust layout, spacing, and sizing for better visual balance --- frontend/src/components/bitcraft/items.tsx | 38 ++++++++------- .../details/buildingdesc-details.tsx | 29 ++++++------ .../components/details/itemdesc-details.tsx | 46 +++++++++++-------- .../details/resourcedesc-details.tsx | 41 ++++++++++------- 4 files changed, 88 insertions(+), 66 deletions(-) diff --git a/frontend/src/components/bitcraft/items.tsx b/frontend/src/components/bitcraft/items.tsx index 6ffc561..9e11089 100644 --- a/frontend/src/components/bitcraft/items.tsx +++ b/frontend/src/components/bitcraft/items.tsx @@ -234,26 +234,30 @@ export const ItemListComponent: Component = (props) => { return ( - + -
- +
+
- + -
- typeof props.probability === 'number' && props.chances && fullNode.toggle() - } +
+
-
-

Weighted List

+
+

Weighted List

+
= (props) => { />
-
Weight
-
Items
+ +
Weight
+
Items
+ {(poss) => ( <> - -
{fixFloat(poss.probability, 3)}
- poss.items}/> + +
{fixFloat(poss.probability, 3)}
+ poss.items} /> )}
diff --git a/frontend/src/components/details/buildingdesc-details.tsx b/frontend/src/components/details/buildingdesc-details.tsx index fd80ad3..f6598c0 100644 --- a/frontend/src/components/details/buildingdesc-details.tsx +++ b/frontend/src/components/details/buildingdesc-details.tsx @@ -40,28 +40,29 @@ type RecipePanelProps = { function RecipePanel(props: RecipePanelProps) { return ( - -
-
+ +
+
{props.getInputs(props.recipe)}
-
- -
-
- {props.getOutputs!(props.recipe)} + +
+ {props.getOutputs(props.recipe)}
-
+
- {pair =>
-
{pair[0]}
-
{pair[1]}
-
} + {([label, value]) => ( +
+
{label}
+
{value}
+
+ )}
+
- ) + ); } type RecipesPanelProps = { diff --git a/frontend/src/components/details/itemdesc-details.tsx b/frontend/src/components/details/itemdesc-details.tsx index 53b9aef..2ff936a 100644 --- a/frontend/src/components/details/itemdesc-details.tsx +++ b/frontend/src/components/details/itemdesc-details.tsx @@ -157,36 +157,44 @@ type RecipePanelProps = { function RecipePanel(props: RecipePanelProps) { return ( - -
-
+ +
+
{props.getInputs(props.recipe)}
-
- -
-
- - {stack => expandStack(stack, props.maskedProbabilities, props.chances)} - - } + +
+ No Outputs
} + > + {(stack) => ( +
+ {expandStack(stack, props.maskedProbabilities, props.chances)} +
+ )} + + } > {props.getOutputs!(props.recipe)}
-
+
- {pair =>
-
{pair[0]}
-
{pair[1]}
-
} + {([label, value]) => ( +
+
{label}
+
{value}
+
+ )}
- ) + ); } type RecipesPanelProps = { diff --git a/frontend/src/components/details/resourcedesc-details.tsx b/frontend/src/components/details/resourcedesc-details.tsx index 1961a76..c99a137 100644 --- a/frontend/src/components/details/resourcedesc-details.tsx +++ b/frontend/src/components/details/resourcedesc-details.tsx @@ -37,32 +37,39 @@ type RecipePanelProps = { function RecipePanel(props: RecipePanelProps) { return ( - -
-
+ +
+
{props.getInputs(props.recipe)}
-
- -
-
- - {stack => expandStack(stack, props.maskedProbabilities, props.chances)} + +
+ No Outputs
+ }> + {(stack) => ( +
+ {expandStack(stack, props.maskedProbabilities, props.chances)} +
+ )}
-
+
- {pair =>
-
{pair[0]}
-
{pair[1]}
-
} + {([label, value]) => ( +
+
{label}
+
{value}
+
+ )}
- ) + ); } + type RecipesPanelProps = { value: Accessor