diff --git a/packages/website/src/components/NavbarMobile.astro b/packages/website/src/components/NavbarMobile.astro
new file mode 100644
index 000000000..f71671795
--- /dev/null
+++ b/packages/website/src/components/NavbarMobile.astro
@@ -0,0 +1,121 @@
+---
+import { CaretUpIcon, GearIcon } from "@radix-ui/react-icons";
+import { api } from "../api/dynamic";
+import type { Tool } from "../constants/tools";
+import type { LocaleAcceptorProps } from "../hooks/useLocale";
+import { Logo } from "../icons/Logo";
+import { Text } from "./Text";
+
+type Props = LocaleAcceptorProps & {
+ tool: Tool;
+};
+
+const { locale, tool } = Astro.props;
+
+const strings = await api.strings(locale);
+---
+
+
+
+
+
+
diff --git a/packages/website/src/components/SegmentedControl/index.module.css b/packages/website/src/components/SegmentedControl/index.module.css
index 2f8200d7e..4178c7e36 100644
--- a/packages/website/src/components/SegmentedControl/index.module.css
+++ b/packages/website/src/components/SegmentedControl/index.module.css
@@ -48,6 +48,19 @@
}
}
+ &[data-variant="overline"] {
+ border-radius: 0;
+
+ .indicator {
+ background: linear-gradient(var(--accent-a2), transparent);
+
+ outline: none;
+ border-radius: 0;
+
+ border-top: var(--space-1) solid var(--accent-9);
+ }
+ }
+
.option {
position: relative;
diff --git a/packages/website/src/components/SegmentedControl/index.tsx b/packages/website/src/components/SegmentedControl/index.tsx
index 58c8bb4bd..a4e5b17fa 100644
--- a/packages/website/src/components/SegmentedControl/index.tsx
+++ b/packages/website/src/components/SegmentedControl/index.tsx
@@ -1,4 +1,5 @@
-import { type ReactNode } from "react";
+import { type ComponentProps, type ReactNode } from "react";
+import { classNames } from "../../ui/classNames";
import styles from "./index.module.css";
export interface SegmentedControlOption {
@@ -6,12 +7,12 @@ export interface SegmentedControlOption {
label: ReactNode;
}
-export interface SegmentedControlProps {
+export interface SegmentedControlProps extends ComponentProps<"div"> {
options: readonly SegmentedControlOption[];
value: string;
onValueChange(value: string): void;
size?: "regular" | "minor";
- variant?: "solid" | "underline";
+ variant?: "solid" | "underline" | "overline";
}
export function SegmentedControl({
@@ -20,19 +21,24 @@ export function SegmentedControl({
onValueChange,
size = "regular",
variant = "solid",
+ className,
+ style,
+ ...props
}: SegmentedControlProps) {
const selectedIndex = options.findIndex((option) => option.value === value);
const segmentWidth = 100 / options.length;
return (
state.tab);
+
+ return (
+
{
+ Tankopedia.mutate((state) => {
+ state.tab = value as TankopediaTab;
+ });
+ }}
+ variant="overline"
+ />
+ );
+}
diff --git a/packages/website/src/layouts/BaseLayout.astro b/packages/website/src/layouts/BaseLayout.astro
index 5786ff55b..9c36b91a3 100644
--- a/packages/website/src/layouts/BaseLayout.astro
+++ b/packages/website/src/layouts/BaseLayout.astro
@@ -3,8 +3,10 @@ import BaseMeta from "../components/BaseMeta.astro";
import BaseStyles from "../components/BaseStyles.astro";
import ColorAlias from "../components/ColorAlias.astro";
import ColorScale from "../components/ColorScale.astro";
-import Navbar from "../components/Navbar.astro";
+import NavbarDesktop from "../components/NavbarDesktop.astro";
+import NavbarMobile from "../components/NavbarMobile.astro";
import SystemTheme from "../components/SystemTheme.astro";
+import { tools } from "../constants/tools";
import type { LocaleAcceptorProps } from "../hooks/useLocale";
import type { Color } from "../ui/color";
@@ -13,6 +15,8 @@ type Props = LocaleAcceptorProps & {
};
const { locale, accent } = Astro.props;
+
+const tool = tools.tanks;
---
@@ -40,14 +44,16 @@ const { locale, accent } = Astro.props;
interpolate-size: allow-keywords;
background-color: var(--gray-1);
+ scrollbar-width: none;
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
}
body {
margin: 0;
- width: 100dvw;
- height: 100dvh;
-
display: flex;
background-color: var(--gray-1);
@@ -57,12 +63,17 @@ const { locale, accent } = Astro.props;
.main {
flex: 1;
}
+
+ @media screen and (max-width: 80rem) {
+ flex-direction: column-reverse;
+ }
}
-
+
+
diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/index2.astro b/packages/website/src/pages/[...chunk_default]/[...locale]/index2.astro
deleted file mode 100644
index 347164213..000000000
--- a/packages/website/src/pages/[...chunk_default]/[...locale]/index2.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-import locales from "@blitzkit/i18n/locales.json";
-import BaseLayout2 from "../../../layouts/BaseLayout2.astro";
-import { getStaticPaths as _getStaticPaths } from "../_index";
-
-import { mixStaticPaths } from "../../../astro/mixStaticPaths";
-
-export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
- return locales.supported.map(({ locale }) => ({
- props: { locale },
- params: { locale: locale === locales.default ? undefined : locale },
- }));
-});
-
-const { locale } = Astro.props;
----
-
-
diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.module.css b/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.module.css
index 39eaf7cc2..5ecb6c124 100644
--- a/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.module.css
+++ b/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.module.css
@@ -1,12 +1,17 @@
.page {
- max-height: 100dvh;
flex-grow: 1;
display: flex;
+ gap: var(--space-4);
+
.sandbox {
flex-grow: 1;
- margin-left: calc(-1 * var(--space-4));
+ padding-top: var(--space-4);
+
+ @media screen and (max-width: 80rem) {
+ padding-top: 0;
+ }
}
.loadout {
@@ -15,6 +20,11 @@
background-color: var(--gray-2);
+ position: sticky;
+ top: 0;
+
+ max-height: 100dvh;
+
.content {
padding: var(--space-5);
@@ -23,4 +33,13 @@
gap: var(--space-5);
}
}
+
+ @media screen and (max-width: 80rem) {
+ .sandbox,
+ .loadout {
+ &[data-tabbed="false"] {
+ display: none;
+ }
+ }
+ }
}
diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.tsx b/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.tsx
index ac924ec45..0d1b270b0 100644
--- a/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.tsx
+++ b/packages/website/src/pages/[...chunk_default]/[...locale]/tanks/[slug]/_index.tsx
@@ -9,13 +9,14 @@ import { TankopediaCharacteristics } from "../../../../../components/TankopediaC
import { TankopediaGameModeAbilities } from "../../../../../components/TankopediaGameModeAbilities";
import { TankopediaLoadout } from "../../../../../components/TankopediaLoadout";
import { TankopediaSandbox } from "../../../../../components/TankopediaSandbox";
+import { TankopediaTabs } from "../../../../../components/TankopediaTabs";
import { TankopediaVideos } from "../../../../../components/TankopediaVideos";
import { defaultEqualizer } from "../../../../../config/equalizer";
import { withErrorWrapper } from "../../../../../hocs/withErrorWrapper";
import { withLocale } from "../../../../../hocs/withLocale";
import { useAwait } from "../../../../../hooks/useAwait";
import { useCharacteristics } from "../../../../../hooks/useCharacteristics";
-import { Tankopedia } from "../../../../../stores/tankopedia";
+import { Tankopedia, TankopediaTab } from "../../../../../stores/tankopedia";
import type { MaybeSkeletonComponentProps } from "../../../../../types/maybeSkeletonComponentProps";
import styles from "./_index.module.css";
@@ -45,9 +46,12 @@ export const Page = withErrorWrapper(
);
function Loadout() {
+ const tabbed = Tankopedia.use((state) => state.tab === TankopediaTab.Loadout);
+
return (
@@ -82,11 +86,10 @@ function Sandbox({ skeleton, tier }: SandboxProps) {
return { value } satisfies ThicknessRange;
}, [protagonist, equalize]);
+ const tabbed = Tankopedia.use((state) => state.tab === TankopediaTab.Sandbox);
+
return (
-
+
-
+
+
+
);
+
+ // return (
+ //
+ //
+ // );
}
diff --git a/packages/website/src/stores/tankopedia.ts b/packages/website/src/stores/tankopedia.ts
index 454d14f73..7504b9c99 100644
--- a/packages/website/src/stores/tankopedia.ts
+++ b/packages/website/src/stores/tankopedia.ts
@@ -102,6 +102,8 @@ interface Tankopedia {
showControls: boolean;
animate: boolean;
+ tab: TankopediaTab;
+
protagonist: TankState;
antagonist: TankState;
environment: TankEnvironment;
@@ -125,6 +127,11 @@ interface Tankopedia {
// statSearch?: string;
}
+export enum TankopediaTab {
+ Sandbox = "sandbox",
+ Loadout = "loadout",
+}
+
const skills = await api.skills();
export const Tankopedia = new Soapstone(
@@ -134,6 +141,8 @@ export const Tankopedia = new Soapstone(
showControls: false,
animate: true,
+ tab: TankopediaTab.Sandbox,
+
protagonist: createTankState(tank),
antagonist: createTankState(tank),
environment: createDefaultEnvironment(skills),