mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-22 05:15:32 +01:00
simplified page padding scheme
This commit is contained in:
30 files changed
+89
-156
No files matched your search
@@ -23,6 +23,7 @@ styles += "}";
|
|||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--page-width: 64rem;
|
--page-width: 64rem;
|
||||||
|
--page-padding: var(--space-4);
|
||||||
|
|
||||||
--max-size: max(100vw, 100vh);
|
--max-size: max(100vw, 100vh);
|
||||||
--radius-max: var(--max-size);
|
--radius-max: var(--max-size);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function CompareTable() {
|
|||||||
}, [members, environment]);
|
}, [members, environment]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table.Root scrollable>
|
<Table.Root>
|
||||||
<Table.Head>
|
<Table.Head>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.IconCorner>
|
<Table.IconCorner>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import HomeSection from "./HomeSection.astro";
|
import { Section } from "./Section";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = await api.strings(locale);
|
const strings = await api.strings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<HomeSection>
|
<Section>
|
||||||
<Heading size="2">{strings.home.cosmetics}</Heading>
|
<Heading size="2">{strings.home.cosmetics}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot minor>
|
<ToolCardLayoutRoot minor>
|
||||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
|||||||
<ToolCard {locale} tool={tools.backgrounds} />
|
<ToolCard {locale} tool={tools.backgrounds} />
|
||||||
</ToolCardLayoutColumn>
|
</ToolCardLayoutColumn>
|
||||||
</ToolCardLayoutRoot>
|
</ToolCardLayoutRoot>
|
||||||
</HomeSection>
|
</Section>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import HomeSection from "./HomeSection.astro";
|
import { Section } from "./Section";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = await api.strings(locale);
|
const strings = await api.strings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<HomeSection>
|
<Section>
|
||||||
<Heading size="2" className="title">{strings.home.games}</Heading>
|
<Heading size="2" className="title">{strings.home.games}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
|||||||
<ToolCard {locale} tool={tools.guesser} />
|
<ToolCard {locale} tool={tools.guesser} />
|
||||||
</ToolCardLayoutColumn>
|
</ToolCardLayoutColumn>
|
||||||
</ToolCardLayoutRoot>
|
</ToolCardLayoutRoot>
|
||||||
</HomeSection>
|
</Section>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import HomeSection from "./HomeSection.astro";
|
import { Section } from "./Section";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = await api.strings(locale);
|
const strings = await api.strings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<HomeSection>
|
<Section>
|
||||||
<Heading size="2">{strings.home.players}</Heading>
|
<Heading size="2">{strings.home.players}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
@@ -30,4 +30,4 @@ const strings = await api.strings(locale);
|
|||||||
<!-- <ToolCard {locale} tool={tools.players} /> -->
|
<!-- <ToolCard {locale} tool={tools.players} /> -->
|
||||||
</ToolCardLayoutColumn>
|
</ToolCardLayoutColumn>
|
||||||
</ToolCardLayoutRoot>
|
</ToolCardLayoutRoot>
|
||||||
</HomeSection>
|
</Section>
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<style>
|
|
||||||
.home-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: var(--space-4);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<div class="home-section">
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import HomeSection from "./HomeSection.astro";
|
import { Section } from "./Section";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = await api.strings(locale);
|
const strings = await api.strings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<HomeSection>
|
<Section>
|
||||||
<Heading size="2">{strings.home.tanks}</Heading>
|
<Heading size="2">{strings.home.tanks}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
|||||||
<ToolCard {locale} minor tool={tools.performance} />
|
<ToolCard {locale} minor tool={tools.performance} />
|
||||||
</ToolCardLayoutColumn>
|
</ToolCardLayoutColumn>
|
||||||
</ToolCardLayoutRoot>
|
</ToolCardLayoutRoot>
|
||||||
</HomeSection>
|
</Section>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import HomeSection from "./HomeSection.astro";
|
import { Section } from "./Section";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = await api.strings(locale);
|
const strings = await api.strings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<HomeSection>
|
<Section>
|
||||||
<Heading size="2">{strings.home.technical}</Heading>
|
<Heading size="2">{strings.home.technical}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot minor>
|
<ToolCardLayoutRoot minor>
|
||||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
|||||||
<ToolCard {locale} tool={tools.changelogs} />
|
<ToolCard {locale} tool={tools.changelogs} />
|
||||||
</ToolCardLayoutColumn>
|
</ToolCardLayoutColumn>
|
||||||
</ToolCardLayoutRoot>
|
</ToolCardLayoutRoot>
|
||||||
</HomeSection>
|
</Section>
|
||||||
@@ -24,7 +24,7 @@ export const filtered = Object.values(tools).filter(
|
|||||||
<style>
|
<style>
|
||||||
#navbar-desktop {
|
#navbar-desktop {
|
||||||
--icon-size: 1.5rem;
|
--icon-size: 1.5rem;
|
||||||
--padding: var(--space-4);
|
--padding: var(--page-padding);
|
||||||
--min-content-width: calc(var(--icon-size) + 2 * var(--padding));
|
--min-content-width: calc(var(--icon-size) + 2 * var(--padding));
|
||||||
|
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
.root {
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export function PerformanceTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table.Root className={styles.root}>
|
<Table.Root>
|
||||||
<Head />
|
<Head />
|
||||||
<Body filtered={filtered} />
|
<Body filtered={filtered} />
|
||||||
</Table.Root>
|
</Table.Root>
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
.section {
|
.section {
|
||||||
padding: var(--space-4);
|
|
||||||
|
|
||||||
@media (pointer: fine) {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
|
|
||||||
|
padding-right: var(--page-padding);
|
||||||
|
|
||||||
|
/* astro island's children sometimes end up being first deeper into the div's */
|
||||||
|
&:first-child:not(astro-island > &) {
|
||||||
|
padding-top: var(--page-padding);
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
padding-bottom: var(--page-padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
@media (pointer: coarse) {
|
||||||
flex: 1;
|
padding-left: var(--page-padding);
|
||||||
max-width: var(--page-width);
|
}
|
||||||
|
|
||||||
gap: var(--space-5);
|
&[data-overflow="true"] {
|
||||||
|
padding-right: 0;
|
||||||
display: flex;
|
overflow-x: auto;
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,17 @@ import type { ComponentProps } from "react";
|
|||||||
import { classNames } from "../../ui/classNames";
|
import { classNames } from "../../ui/classNames";
|
||||||
import styles from "./index.module.css";
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
export interface SectionProps extends ComponentProps<"div"> {}
|
export interface SectionProps extends ComponentProps<"section"> {
|
||||||
|
overflow?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: reevaluate the usefulness of this as it seems to do very little
|
// TODO: reevaluate the usefulness of this as it seems to do very little
|
||||||
export function Section({ className, children, ...props }: SectionProps) {
|
export function Section({ className, overflow, ...props }: SectionProps) {
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.section, className)} {...props}>
|
<section
|
||||||
<div className={styles.content}>{children}</div>
|
className={classNames(styles.section, className)}
|
||||||
</div>
|
data-overflow={overflow || undefined}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
.scroller {
|
|
||||||
/* Fits the table, centered by the parent, never wider than the page */
|
|
||||||
max-width: 100%;
|
|
||||||
|
|
||||||
border: var(--space-0) solid var(--gray-a5);
|
|
||||||
border-radius: var(--space-3);
|
|
||||||
/* Clips the corners without becoming a scroll container, so sticky headers follow the page */
|
|
||||||
overflow: clip;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
|
border-radius: var(--space-3);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
border-collapse: separate;
|
border-collapse: separate;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
|
||||||
|
width: fit-content;
|
||||||
|
margin: auto;
|
||||||
|
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: var(--space-3);
|
padding: var(--space-3);
|
||||||
|
|||||||
@@ -13,16 +13,12 @@ import { Logo } from "../../icons/Logo";
|
|||||||
import { SortDirection } from "../../stores/tankopediaPersistent";
|
import { SortDirection } from "../../stores/tankopediaPersistent";
|
||||||
import { CharacteristicRanking } from "../../types/characteristics";
|
import { CharacteristicRanking } from "../../types/characteristics";
|
||||||
import { classNames } from "../../ui/classNames";
|
import { classNames } from "../../ui/classNames";
|
||||||
import { Scroller, ScrollerOrientation } from "../Scroller";
|
|
||||||
import styles from "./index.module.css";
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
interface RootProps
|
interface RootProps extends ComponentProps<"table"> {}
|
||||||
extends Omit<ComponentProps<typeof Scroller>, "orientation"> {
|
|
||||||
scrollable?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// When scrollable, scrolls both ways, keeping the head, the row headers and the group titles in view
|
// When scrollable, scrolls both ways, keeping the head, the row headers and the group titles in view
|
||||||
function Root({ children, className, scrollable, ...props }: RootProps) {
|
function Root({ children, className, ...props }: RootProps) {
|
||||||
const table = useRef<HTMLTableElement>(null);
|
const table = useRef<HTMLTableElement>(null);
|
||||||
|
|
||||||
// Group titles stick right below the head, whatever its height
|
// Group titles stick right below the head, whatever its height
|
||||||
@@ -42,30 +38,12 @@ function Root({ children, className, scrollable, ...props }: RootProps) {
|
|||||||
|
|
||||||
return () => observer.disconnect();
|
return () => observer.disconnect();
|
||||||
}, []);
|
}, []);
|
||||||
const content = (
|
|
||||||
|
return (
|
||||||
<table ref={table} className={styles.table}>
|
<table ref={table} className={styles.table}>
|
||||||
{children}
|
{children}
|
||||||
</table>
|
</table>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!scrollable) {
|
|
||||||
return (
|
|
||||||
<div className={classNames(styles.scroller, className)} {...props}>
|
|
||||||
{content}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Scroller
|
|
||||||
orientation={ScrollerOrientation.Both}
|
|
||||||
startCurtain={false}
|
|
||||||
className={classNames(styles.scroller, className)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{content}
|
|
||||||
</Scroller>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Head(props: ComponentProps<"thead">) {
|
function Head(props: ComponentProps<"thead">) {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
||||||
@media (pointer: fine) {
|
@media (pointer: fine) {
|
||||||
margin: var(--margin) var(--margin) 0 0;
|
|
||||||
border-radius: var(--space-4);
|
border-radius: var(--space-4);
|
||||||
|
margin: var(--page-padding) var(--page-padding) 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ const { locale, accent, solidNavbar = false, tool } = Astro.props;
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
gap: var(--page-padding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,26 +1,6 @@
|
|||||||
.page {
|
|
||||||
/* Fixed to the viewport so the table scrolls, not the page */
|
|
||||||
height: 100dvh;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--space-4);
|
gap: var(--space-4);
|
||||||
|
|
||||||
padding: var(--space-4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
|
||||||
align-self: stretch;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import { api } from "../../../../api/dynamic";
|
|||||||
import { CompareControls } from "../../../../components/CompareControls";
|
import { CompareControls } from "../../../../components/CompareControls";
|
||||||
import { CompareTable } from "../../../../components/CompareTable";
|
import { CompareTable } from "../../../../components/CompareTable";
|
||||||
import { EmptyState } from "../../../../components/EmptyState";
|
import { EmptyState } from "../../../../components/EmptyState";
|
||||||
|
import { Section } from "../../../../components/Section";
|
||||||
import { tankToCompareMember } from "../../../../core/blitzkit/tankToCompareMember";
|
import { tankToCompareMember } from "../../../../core/blitzkit/tankToCompareMember";
|
||||||
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
||||||
import { withLocale } from "../../../../hocs/withLocale";
|
import { withLocale } from "../../../../hocs/withLocale";
|
||||||
@@ -59,23 +60,27 @@ function Content() {
|
|||||||
}, [members]);
|
}, [members]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.page}>
|
<>
|
||||||
|
<Section>
|
||||||
<div className={styles.top}>
|
<div className={styles.top}>
|
||||||
<CompareControls />
|
<CompareControls />
|
||||||
</div>
|
</div>
|
||||||
|
</Section>
|
||||||
|
|
||||||
{members.length > 0 && (
|
{members.length > 0 && (
|
||||||
<div className={styles.table}>
|
<Section overflow>
|
||||||
<CompareTable />
|
<CompareTable />
|
||||||
</div>
|
</Section>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{members.length === 0 && (
|
{members.length === 0 && (
|
||||||
|
<Section>
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title={strings.compare.no_tanks.title}
|
title={strings.compare.no_tanks.title}
|
||||||
body={strings.compare.no_tanks.body}
|
body={strings.compare.no_tanks.body}
|
||||||
/>
|
/>
|
||||||
|
</Section>
|
||||||
)}
|
)}
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import ColorScale from "../../../../components/ColorScale.astro";
|
import ColorScale from "../../../../components/ColorScale.astro";
|
||||||
|
import ToolBanner from "../../../../components/ToolBanner.astro";
|
||||||
import { tools } from "../../../../constants/tools";
|
import { tools } from "../../../../constants/tools";
|
||||||
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||||
import { Page } from "./_index";
|
import { Page } from "./_index";
|
||||||
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
|
|||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout tool={tools.compare} accent="pink" {locale}>
|
|
||||||
<ColorScale color="red" />
|
<ColorScale color="red" />
|
||||||
<ColorScale color="jade" />
|
<ColorScale color="jade" />
|
||||||
<ColorScale color="amber" />
|
<ColorScale color="amber" />
|
||||||
<ColorScale color="blue" />
|
<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 />
|
<Page {locale} client:load />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
@@ -17,11 +17,11 @@ const iconLayouts = ["leading", "trailing", "both", "icon only"] as const;
|
|||||||
const extraColors = ["red", "amber", "green"] satisfies Color[];
|
const extraColors = ["red", "amber", "green"] satisfies Color[];
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout tool={tools.home} accent="blue" {locale}>
|
|
||||||
{extraColors.map((color) => (
|
{extraColors.map((color) => (
|
||||||
<ColorScale {color} />
|
<ColorScale {color} />
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
<BaseLayout tool={tools.home} accent="blue" {locale}>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<h1>Badge</h1>
|
<h1>Badge</h1>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,8 +8,8 @@ export { getStaticPaths } from "../index.astro";
|
|||||||
const { locale, embed } = Astro.props;
|
const { locale, embed } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<EmbedLayout {locale}>
|
|
||||||
<ColorScale color="red" />
|
<ColorScale color="red" />
|
||||||
|
|
||||||
|
<EmbedLayout {locale}>
|
||||||
<Page {locale} client:only="react" {embed} />
|
<Page {locale} client:only="react" {embed} />
|
||||||
</EmbedLayout>
|
</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
|
// 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} client:only="react">
|
||||||
<Page {locale} skeleton slot="fallback" />
|
<Page {locale} skeleton slot="fallback" />
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import HomeGames from "../../../components/HomeGames.astro";
|
|||||||
import HomePlayers from "../../../components/HomePlayers.astro";
|
import HomePlayers from "../../../components/HomePlayers.astro";
|
||||||
import HomeTanks from "../../../components/HomeTanks.astro";
|
import HomeTanks from "../../../components/HomeTanks.astro";
|
||||||
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
||||||
import { Section } from "../../../components/Section";
|
|
||||||
import { tools, type Tool } from "../../../constants/tools";
|
import { tools, type Tool } from "../../../constants/tools";
|
||||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
import { getStaticPaths as _getStaticPaths } from "../_index";
|
import { getStaticPaths as _getStaticPaths } from "../_index";
|
||||||
@@ -53,13 +52,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
|||||||
|
|
||||||
{environment === "preview" && <AesonPlug />}
|
{environment === "preview" && <AesonPlug />}
|
||||||
|
|
||||||
<Section>
|
|
||||||
<HomeTanks {locale} />
|
<HomeTanks {locale} />
|
||||||
<HomePlayers {locale} />
|
<HomePlayers {locale} />
|
||||||
<HomeGames {locale} />
|
<HomeGames {locale} />
|
||||||
<HomeCosmetics {locale} />
|
<HomeCosmetics {locale} />
|
||||||
<HomeTechnical {locale} />
|
<HomeTechnical {locale} />
|
||||||
</Section>
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
||||||
<!-- TODO: read temp/notes.md for user testing fixes -->
|
<!-- TODO: read temp/notes.md for user testing fixes -->
|
||||||
-15
@@ -1,21 +1,6 @@
|
|||||||
.page {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--space-4);
|
gap: var(--space-4);
|
||||||
|
|
||||||
padding: var(--space-4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
|
||||||
align-self: stretch;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
import { PerformanceControls } from "../../../../components/PerformanceControls";
|
import { PerformanceControls } from "../../../../components/PerformanceControls";
|
||||||
import { PerformanceTable } from "../../../../components/PerformanceTable";
|
import { PerformanceTable } from "../../../../components/PerformanceTable";
|
||||||
|
import { Section } from "../../../../components/Section";
|
||||||
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
||||||
import { withLocale } from "../../../../hocs/withLocale";
|
import { withLocale } from "../../../../hocs/withLocale";
|
||||||
import styles from "./_index.module.css";
|
import styles from "./_index.module.css";
|
||||||
|
|
||||||
export const Page = withLocale(
|
export const Page = withLocale(
|
||||||
withErrorWrapper(() => (
|
withErrorWrapper(() => (
|
||||||
<div className={styles.page}>
|
<>
|
||||||
|
<Section>
|
||||||
<div className={styles.top}>
|
<div className={styles.top}>
|
||||||
<PerformanceControls />
|
<PerformanceControls />
|
||||||
</div>
|
</div>
|
||||||
|
</Section>
|
||||||
|
|
||||||
<div className={styles.table}>
|
<Section overflow>
|
||||||
<PerformanceTable />
|
<PerformanceTable />
|
||||||
</div>
|
</Section>
|
||||||
</div>
|
</>
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import ColorScale from "../../../../components/ColorScale.astro";
|
import ColorScale from "../../../../components/ColorScale.astro";
|
||||||
|
import ToolBanner from "../../../../components/ToolBanner.astro";
|
||||||
import { tools } from "../../../../constants/tools";
|
import { tools } from "../../../../constants/tools";
|
||||||
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||||
import { Page } from "./_index";
|
import { Page } from "./_index";
|
||||||
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
|
|||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout tool={tools.performance} accent="jade" {locale}>
|
|
||||||
<ColorScale color="red" />
|
<ColorScale color="red" />
|
||||||
<ColorScale color="jade" />
|
<ColorScale color="jade" />
|
||||||
<ColorScale color="amber" />
|
<ColorScale color="amber" />
|
||||||
<ColorScale color="blue" />
|
<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 />
|
<Page {locale} client:load />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
@@ -20,11 +20,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
const { id, locale } = Astro.props;
|
const { id, locale } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout tool={tools.tanks} {locale} accent="violet">
|
|
||||||
<ColorScale color="ruby" />
|
<ColorScale color="ruby" />
|
||||||
<ColorScale color="cyan" />
|
<ColorScale color="cyan" />
|
||||||
<ColorScale color="green" />
|
<ColorScale color="green" />
|
||||||
<ColorRanks />
|
<ColorRanks />
|
||||||
|
|
||||||
|
<BaseLayout tool={tools.tanks} {locale} accent="violet">
|
||||||
<Page {id} {locale} client:load />
|
<Page {id} {locale} client:load />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
@@ -1,17 +1,7 @@
|
|||||||
import { TankSearch } from "../../../../components/TankSearch";
|
import { TankSearch } from "../../../../components/TankSearch";
|
||||||
import {
|
import { withLocale } from "../../../../hocs/withLocale";
|
||||||
LocaleProvider,
|
|
||||||
type LocaleAcceptorProps,
|
|
||||||
} from "../../../../hooks/useLocale";
|
|
||||||
import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
|
import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
|
||||||
|
|
||||||
export function Page({
|
export const Page = withLocale<MaybeSkeletonComponentProps>(({ skeleton }) => (
|
||||||
locale,
|
|
||||||
skeleton,
|
|
||||||
}: LocaleAcceptorProps & MaybeSkeletonComponentProps) {
|
|
||||||
return (
|
|
||||||
<LocaleProvider locale={locale}>
|
|
||||||
<TankSearch skeleton={skeleton} />
|
<TankSearch skeleton={skeleton} />
|
||||||
</LocaleProvider>
|
));
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -11,15 +11,15 @@ export { getStaticPaths } from "../index.astro";
|
|||||||
const { locale } = Astro.props;
|
const { locale } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout tool={tools.tanks} {locale} accent="purple">
|
|
||||||
<ColorScale color="blue" />
|
<ColorScale color="blue" />
|
||||||
<ColorScale color="amber" />
|
<ColorScale color="amber" />
|
||||||
<ColorScale color="red" />
|
<ColorScale color="red" />
|
||||||
|
|
||||||
|
<BaseLayout tool={tools.tanks} {locale} accent="purple">
|
||||||
<ToolBanner {locale} tool={tools.tanks} />
|
<ToolBanner {locale} tool={tools.tanks} />
|
||||||
|
|
||||||
<Section>
|
|
||||||
<!-- TODO: eliminate all client:only's -->
|
<!-- TODO: eliminate all client:only's -->
|
||||||
|
<Section>
|
||||||
<Page {locale} client:only="react">
|
<Page {locale} client:only="react">
|
||||||
<Page {locale} skeleton slot="fallback" />
|
<Page {locale} skeleton slot="fallback" />
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
Reference in new issue
Block a user