Skip to content

Commit

Permalink
fix item grid not high enough
Browse files Browse the repository at this point in the history
  • Loading branch information
huww98 authored Dec 25, 2023
1 parent d7ab9ff commit 4044dd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/ItemSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{{ t('建筑公式') }}
</div>
</div>
<div class="icon-grid">
<div class="icon-grid item">
<BuildingIcon v-for="i of iconsLeft" :icon-id="itemIconId(i.id)" :key="i.id"
:style="{gridRow: i.grid[1], gridColumn: i.grid[2]}"
@click="selected(i)"/>
</div>
<div class="icon-grid">
<div class="icon-grid item">
<BuildingIcon v-for="i of iconsRight" :icon-id="itemIconId(i.id)" :key="i.id"
:style="{gridRow: i.grid[1], gridColumn: i.grid[2] - 7}"
@click="selected(i)"/>
Expand Down
14 changes: 10 additions & 4 deletions src/components/RecipeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{{ t('建筑公式') }}
</div>
</div>
<div class="icon-grid">
<div class="icon-grid recipe">
<BuildingIcon v-for="i of iconsLeft" :icon-id="recipeIconId(i.id)" :key="i.id"
:style="{gridRow: i.grid[1], gridColumn: i.grid[2]}"
@click="selected(i)"/>
</div>
<div class="icon-grid">
<div class="icon-grid recipe">
<BuildingIcon v-for="i of iconsRight" :icon-id="recipeIconId(i.id)" :key="i.id"
:style="{gridRow: i.grid[1], gridColumn: i.grid[2] - 7}"
@click="selected(i)"/>
Expand Down Expand Up @@ -73,9 +73,15 @@ const selected = (i: Recipe | null) => {
@media screen and (max-width: 640px) {
display: grid;
}
grid-template: repeat(7, 1fr) / repeat(7, 1fr);
--cell-size: 40px;
height: calc(7 * var(--cell-size));
&.recipe {
grid-template: repeat(7, 1fr) / repeat(7, 1fr);
height: calc(7 * var(--cell-size));
}
&.item {
grid-template: repeat(8, 1fr) / repeat(7, 1fr);
height: calc(8 * var(--cell-size));
}
width: calc(7 * var(--cell-size));
.icon {
Expand Down

0 comments on commit 4044dd3

Please sign in to comment.