diff --git a/Pkmds.Rcl/Components/BoxGrid.razor b/Pkmds.Rcl/Components/BoxGrid.razor index 4f0db2b7..9f6c3afd 100644 --- a/Pkmds.Rcl/Components/BoxGrid.razor +++ b/Pkmds.Rcl/Components/BoxGrid.razor @@ -2,19 +2,16 @@ @if (BoxEdit is not null) { - +
@for (var i = 0; i < (AppState.SaveFile?.BoxSlotCount ?? 0); i++) { var slotNum = i; var pkm = BoxEdit[slotNum]; - - - + + + } - +
} diff --git a/Pkmds.Rcl/Components/BoxGrid.razor.cs b/Pkmds.Rcl/Components/BoxGrid.razor.cs index c569d1e5..bb30e37a 100644 --- a/Pkmds.Rcl/Components/BoxGrid.razor.cs +++ b/Pkmds.Rcl/Components/BoxGrid.razor.cs @@ -8,11 +8,7 @@ public partial class BoxGrid : IDisposable [Parameter, EditorRequired] public int BoxNumber { get; set; } - private static int GridHeight => (56 + 4 + 5) * 6; - - private int GridWidth => (68 + 4 + 5) * (AppState.SaveFile?.BoxSlotCount == 20 ? 4 : 6); - - private string GridStyle => $"width: {GridWidth}px; height: {GridHeight}px;"; + private string BoxGridClass => AppState.SaveFile?.BoxSlotCount == 20 ? "box-grid-20" : "box-grid-30"; protected override void OnInitialized() => RefreshService.OnAppStateChanged += StateHasChanged; diff --git a/Pkmds.Rcl/Components/BoxGrid.razor.css b/Pkmds.Rcl/Components/BoxGrid.razor.css new file mode 100644 index 00000000..80dd1d22 --- /dev/null +++ b/Pkmds.Rcl/Components/BoxGrid.razor.css @@ -0,0 +1,15 @@ +.box-grid-30 { + width: 480px; + height: 400px; + display: grid; + grid-template-columns: repeat(6, 80px); + grid-template-rows: repeat(5, 80px); +} + +.box-grid-20 { + width: 320px; + height: 400px; + display: grid; + grid-template-columns: repeat(4, 80px); + grid-template-rows: repeat(5, 80px); +} diff --git a/Pkmds.Rcl/Components/SaveFileComponent.razor b/Pkmds.Rcl/Components/SaveFileComponent.razor index 41049b8d..35c78652 100644 --- a/Pkmds.Rcl/Components/SaveFileComponent.razor +++ b/Pkmds.Rcl/Components/SaveFileComponent.razor @@ -13,7 +13,7 @@ Height="50px" />
} } @@ -31,7 +31,7 @@ else Justify="@Justify.FlexStart"> + Style="max-width: 480px;">