simplified page padding scheme

This commit is contained in:
tresabhi committed 2026-11-21 19:33:55 -06:00
1 parent baf42d0273
commit 9efcb55083
30 files changed
+129 -196

No files matched your search

@@ -1,26 +1,6 @@
.page {
/* Fixed to the viewport so the table scrolls, not the page */
height: 100dvh;
.top {
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
.top {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-4);
padding: var(--space-4);
}
.table {
align-self: stretch;
overflow: hidden;
display: flex;
justify-content: center;
}
gap: var(--space-4);
}
@@ -4,6 +4,7 @@ import { api } from "../../../../api/dynamic";
import { CompareControls } from "../../../../components/CompareControls";
import { CompareTable } from "../../../../components/CompareTable";
import { EmptyState } from "../../../../components/EmptyState";
import { Section } from "../../../../components/Section";
import { tankToCompareMember } from "../../../../core/blitzkit/tankToCompareMember";
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
import { withLocale } from "../../../../hocs/withLocale";
@@ -59,23 +60,27 @@ function Content() {
}, [members]);
return (
<div className={styles.page}>
<div className={styles.top}>
<CompareControls />
</div>
<>
<Section>
<div className={styles.top}>
<CompareControls />
</div>
</Section>
{members.length > 0 && (
<div className={styles.table}>
<Section overflow>
<CompareTable />
</div>
</Section>
)}
{members.length === 0 && (
<EmptyState
title={strings.compare.no_tanks.title}
body={strings.compare.no_tanks.body}
/>
<Section>
<EmptyState
title={strings.compare.no_tanks.title}
body={strings.compare.no_tanks.body}
/>
</Section>
)}
</div>
</>
);
}
@@ -1,5 +1,6 @@
---
import ColorScale from "../../../../components/ColorScale.astro";
import ToolBanner from "../../../../components/ToolBanner.astro";
import { tools } from "../../../../constants/tools";
import BaseLayout from "../../../../layouts/BaseLayout.astro";
import { Page } from "./_index";
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
---
<BaseLayout tool={tools.compare} accent="pink" {locale}>
<ColorScale color="red" />
<ColorScale color="jade" />
<ColorScale color="amber" />
<ColorScale color="blue" />
<ColorScale color="red" />
<ColorScale color="jade" />
<ColorScale color="amber" />
<ColorScale color="blue" />
<BaseLayout tool={tools.compare} accent="pink" {locale}>
<!-- TODO: add svg art for this tool -->
<ToolBanner tool={tools.compare} {locale} />
<Page {locale} client:load />
</BaseLayout>
@@ -17,11 +17,11 @@ const iconLayouts = ["leading", "trailing", "both", "icon only"] as const;
const extraColors = ["red", "amber", "green"] satisfies Color[];
---
<BaseLayout tool={tools.home} accent="blue" {locale}>
{extraColors.map((color) => (
<ColorScale {color} />
))}
{extraColors.map((color) => (
<ColorScale {color} />
))}
<BaseLayout tool={tools.home} accent="blue" {locale}>
<div class="page">
<h1>Badge</h1>
@@ -8,8 +8,8 @@ export { getStaticPaths } from "../index.astro";
const { locale, embed } = Astro.props;
---
<EmbedLayout {locale}>
<ColorScale color="red" />
<ColorScale color="red" />
<EmbedLayout {locale}>
<Page {locale} client:only="react" {embed} />
</EmbedLayout>
@@ -11,9 +11,9 @@ const { locale } = Astro.props;
// TODO: the tank search popup is complete unreviewed AI slop, write a proper system for it manually
---
<BaseLayout tool={tools.guesser} accent="blue" {locale} solidNavbar>
<ColorScale color="red" />
<ColorScale color="red" />
<BaseLayout tool={tools.guesser} accent="blue" {locale} solidNavbar>
<Page {locale} client:only="react">
<Page {locale} skeleton slot="fallback" />
</Page>
@@ -9,7 +9,6 @@ import HomeGames from "../../../components/HomeGames.astro";
import HomePlayers from "../../../components/HomePlayers.astro";
import HomeTanks from "../../../components/HomeTanks.astro";
import HomeTechnical from "../../../components/HomeTechnical.astro";
import { Section } from "../../../components/Section";
import { tools, type Tool } from "../../../constants/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro";
import { getStaticPaths as _getStaticPaths } from "../_index";
@@ -53,13 +52,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
{environment === "preview" && <AesonPlug />}
<Section>
<HomeTanks {locale} />
<HomePlayers {locale} />
<HomeGames {locale} />
<HomeCosmetics {locale} />
<HomeTechnical {locale} />
</Section>
<HomeTanks {locale} />
<HomePlayers {locale} />
<HomeGames {locale} />
<HomeCosmetics {locale} />
<HomeTechnical {locale} />
</BaseLayout>
<!-- TODO: read temp/notes.md for user testing fixes -->
@@ -1,21 +1,6 @@
.page {
.top {
display: flex;
flex-direction: column;
align-items: center;
.top {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-4);
padding: var(--space-4);
}
.table {
align-self: stretch;
display: flex;
justify-content: center;
}
gap: var(--space-4);
}
@@ -1,19 +1,22 @@
import { PerformanceControls } from "../../../../components/PerformanceControls";
import { PerformanceTable } from "../../../../components/PerformanceTable";
import { Section } from "../../../../components/Section";
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
import { withLocale } from "../../../../hocs/withLocale";
import styles from "./_index.module.css";
export const Page = withLocale(
withErrorWrapper(() => (
<div className={styles.page}>
<div className={styles.top}>
<PerformanceControls />
</div>
<>
<Section>
<div className={styles.top}>
<PerformanceControls />
</div>
</Section>
<div className={styles.table}>
<Section overflow>
<PerformanceTable />
</div>
</div>
</Section>
</>
)),
);
@@ -1,5 +1,6 @@
---
import ColorScale from "../../../../components/ColorScale.astro";
import ToolBanner from "../../../../components/ToolBanner.astro";
import { tools } from "../../../../constants/tools";
import BaseLayout from "../../../../layouts/BaseLayout.astro";
import { Page } from "./_index";
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
---
<BaseLayout tool={tools.performance} accent="jade" {locale}>
<ColorScale color="red" />
<ColorScale color="jade" />
<ColorScale color="amber" />
<ColorScale color="blue" />
<ColorScale color="red" />
<ColorScale color="jade" />
<ColorScale color="amber" />
<ColorScale color="blue" />
<BaseLayout tool={tools.performance} accent="jade" {locale}>
<!-- TODO: add svg art for this tool -->
<ToolBanner tool={tools.performance} {locale} />
<Page {locale} client:load />
</BaseLayout>
@@ -20,11 +20,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const { id, locale } = Astro.props;
---
<BaseLayout tool={tools.tanks} {locale} accent="violet">
<ColorScale color="ruby" />
<ColorScale color="cyan" />
<ColorScale color="green" />
<ColorRanks />
<ColorScale color="ruby" />
<ColorScale color="cyan" />
<ColorScale color="green" />
<ColorRanks />
<BaseLayout tool={tools.tanks} {locale} accent="violet">
<Page {id} {locale} client:load />
</BaseLayout>
@@ -1,17 +1,7 @@
import { TankSearch } from "../../../../components/TankSearch";
import {
LocaleProvider,
type LocaleAcceptorProps,
} from "../../../../hooks/useLocale";
import { withLocale } from "../../../../hocs/withLocale";
import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
export function Page({
locale,
skeleton,
}: LocaleAcceptorProps & MaybeSkeletonComponentProps) {
return (
<LocaleProvider locale={locale}>
<TankSearch skeleton={skeleton} />
</LocaleProvider>
);
}
export const Page = withLocale<MaybeSkeletonComponentProps>(({ skeleton }) => (
<TankSearch skeleton={skeleton} />
));
@@ -11,15 +11,15 @@ export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
---
<BaseLayout tool={tools.tanks} {locale} accent="purple">
<ColorScale color="blue" />
<ColorScale color="amber" />
<ColorScale color="red" />
<ColorScale color="blue" />
<ColorScale color="amber" />
<ColorScale color="red" />
<BaseLayout tool={tools.tanks} {locale} accent="purple">
<ToolBanner {locale} tool={tools.tanks} />
<!-- TODO: eliminate all client:only's -->
<Section>
<!-- TODO: eliminate all client:only's -->
<Page {locale} client:only="react">
<Page {locale} skeleton slot="fallback" />
</Page>