fix: grid max-height

This commit is contained in:
2025-03-28 13:23:42 +01:00
parent b3a3e79c9a
commit 0751a9142b

View File

@@ -177,11 +177,7 @@ fn View() -> impl IntoView {
<Wall />
</div>
<div class="flex-auto flex flex-col" style="width:38rem">
<crate::components::header_v2::Header>
<div>Ascend</div>
</crate::components::header_v2::Header>
<div class="flex flex-col" style="width:38rem">
<Section title="Filter">
<Filter />
</Section>
@@ -204,6 +200,8 @@ fn View() -> impl IntoView {
<History />
</div>
<div class="flex-auto" />
</div>
}
}
@@ -440,11 +438,12 @@ fn Wall() -> impl IntoView {
let style = {
let grid_rows = crate::css::grid_rows_n(wall.rows);
let grid_cols = crate::css::grid_cols_n(wall.cols);
format!("max-height: 100vh; {}", [grid_rows, grid_cols].join(" "))
let max_width = format!("{}vh", wall.rows as f64 / wall.cols as f64 * 100.);
format!("max-height: 100vh; max-width: {max_width}; {}", [grid_rows, grid_cols].join(" "))
};
view! {
<div style=style class="m-2 grid gap-1">
<div style=style class="p-1 grid gap-1">
{cells}
</div>
}
@@ -464,7 +463,7 @@ fn Hold(
crate::tracing::on_enter!();
move || {
let mut class = "bg-sky-100 aspect-square rounded-sm hover:brightness-125".to_string();
let mut class = "bg-sky-100 max-w-full max-h-full aspect-square rounded-sm hover:brightness-125".to_string();
if let Some(role) = role {
let role = role.get();