From 4694d495bb8063d071cb0dea96eca9de1363d833 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:58:21 -0500 Subject: [PATCH] well at least some of it is showing up i guess --- .../SegmentedControl/index.module.css | 7 + .../TankopediaOptions/index.module.css | 27 ++ .../components/TankopediaOptions/index.tsx | 394 +++++++++--------- .../components/TankopediaSandbox/index.tsx | 2 + 4 files changed, 228 insertions(+), 202 deletions(-) create mode 100644 packages/website/src/components/TankopediaOptions/index.module.css diff --git a/packages/website/src/components/SegmentedControl/index.module.css b/packages/website/src/components/SegmentedControl/index.module.css index 53cafc06a..2f8200d7e 100644 --- a/packages/website/src/components/SegmentedControl/index.module.css +++ b/packages/website/src/components/SegmentedControl/index.module.css @@ -69,6 +69,13 @@ .label { white-space: nowrap; + + line-height: 1; + + img, + svg { + height: 1em; + } } &:has(input:checked) { diff --git a/packages/website/src/components/TankopediaOptions/index.module.css b/packages/website/src/components/TankopediaOptions/index.module.css new file mode 100644 index 000000000..a06b10353 --- /dev/null +++ b/packages/website/src/components/TankopediaOptions/index.module.css @@ -0,0 +1,27 @@ +.options { + display: flex; + flex-direction: column; + gap: var(--space-4); + align-items: center; + + transition: var(--duration-brief); + + position: absolute; + left: 50%; + bottom: var(--space-4); + + transform: translate(-50%, calc(100% + var(--space-4)) s); + + &[data-visible="true"] { + transform: translate(-50%, 0); + } + + .controls { + display: flex; + gap: var(--space-4); + align-items: center; + } + + .tabs { + } +} diff --git a/packages/website/src/components/TankopediaOptions/index.tsx b/packages/website/src/components/TankopediaOptions/index.tsx index 666e0cb9a..1d9b8d698 100644 --- a/packages/website/src/components/TankopediaOptions/index.tsx +++ b/packages/website/src/components/TankopediaOptions/index.tsx @@ -1,6 +1,5 @@ -import { alias, romanize, uniqueGuns } from "@blitzkit/core"; -import { literals } from "@blitzkit/i18n/src/literals"; -import { Flex, IconButton, Popover, Text } from "@radix-ui/themes"; +import { uniqueGuns } from "@blitzkit/core"; +import { ShadowInnerIcon, ShadowNoneIcon } from "@radix-ui/react-icons"; import { useState, type RefObject } from "react"; import { DuelModule, useDuel } from "../../hooks/useDuel"; import { useEquipment } from "../../hooks/useEquipment"; @@ -11,26 +10,16 @@ import { useUnwrapper } from "../../hooks/useUnwrapper"; import { Tankopedia } from "../../stores/tankopedia"; import { TankopediaPersistent } from "../../stores/tankopediaPersistent"; import { TankopediaDisplay } from "../../stores/tankopediaPersistent/constants"; -import type { ComputedCharacteristics } from "../../types/characteristics"; import type { MaybeSkeletonComponentProps } from "../../types/maybeSkeletonComponentProps"; -import { EqualIcon } from "../EqualIcon"; -import { ModuleButton } from "../ModuleButtons/ModuleButton"; -import { - SidebarIconButton, - SidebarIconGroup, -} from "../TankopediaSidebarIconButtons"; -import { CustomShellButton } from "./components/CustomShellButton"; +import { IconButton } from "../IconButton"; +import { SegmentedControl } from "../SegmentedControl"; +import styles from "./index.module.css"; type OptionsProps = MaybeSkeletonComponentProps & { canvas: RefObject; - antagonistCharacteristics: ComputedCharacteristics; }; -export function TankopediaOptions({ - canvas, - skeleton, - antagonistCharacteristics, -}: OptionsProps) { +export function TankopediaOptions({ canvas, skeleton }: OptionsProps) { const strings = useStrings(); const unwrap = useUnwrapper(); @@ -59,215 +48,216 @@ export function TankopediaOptions({ const equalize = Tankopedia.use((state) => state.environment.equalize); return ( - <> - +
+
+ {disturbed && ( + <> + {requestedDisplay === TankopediaDisplay.DynamicArmor && ( + { + TankopediaPersistent.mutate((draft) => { + draft.advancedHighlighting = !draft.advancedHighlighting; + }); + }} + color={advancedHighlighting ? undefined : "gray"} + variant={advancedHighlighting ? "solid" : "surface"} + > + {advancedHighlighting ? ( + + ) : ( + + )} + + )} - {/* - - {disturbed && ( - <> - {requestedDisplay === TankopediaDisplay.DynamicArmor && ( + {/* + { - TankopediaPersistent.mutate((draft) => { - draft.advancedHighlighting = !draft.advancedHighlighting; - }); - }} - color={advancedHighlighting ? undefined : "gray"} - variant={advancedHighlighting ? "solid" : "surface"} + color="gray" > - {advancedHighlighting ? ( - - ) : ( - - )} + - )} + - - - - - - + + poseEvent.emit(Pose.HullDown)} + > + {strings.tanks.poses.hull_down} + - - poseEvent.emit(Pose.HullDown)} - > - {strings.tanks.poses.hull_down} - + poseEvent.emit(Pose.FaceHug)}> + {strings.tanks.poses.face_hug} + - poseEvent.emit(Pose.FaceHug)} - > - {strings.tanks.poses.face_hug} - + poseEvent.emit(Pose.Default)}> + {strings.tanks.poses.default} + + + */} - poseEvent.emit(Pose.Default)} - > - {strings.tanks.poses.default} - - - + { + TankopediaPersistent.mutate((draft) => { + draft.highGraphics = !draft.highGraphics; + }); + }} + color={highGraphics ? undefined : "gray"} + variant={highGraphics ? "solid" : "surface"} + > + + + + + {fullScreenAvailable && ( { - TankopediaPersistent.mutate((draft) => { - draft.highGraphics = !draft.highGraphics; - }); + if (isFullScreen) { + document.exitFullscreen(); + } else document.body.requestFullscreen(); }} - color={highGraphics ? undefined : "gray"} - variant={highGraphics ? "solid" : "surface"} + color={isFullScreen ? undefined : "gray"} + variant={isFullScreen ? "solid" : "surface"} > - + {isFullScreen ? ( + + ) : ( + + )} + )} + + )} +
- +
+ { + Tankopedia.mutate((draft) => { + draft.requestedDisplay = Number(value); + }); + }} + value={`${requestedDisplay}`} + options={[ + { + label: , + value: `${TankopediaDisplay.Model}`, + }, + { + label: ( + + ), + value: `${TankopediaDisplay.DynamicArmor}`, + }, + { + label: ( + + ), + value: `${TankopediaDisplay.StaticArmor}`, + }, + ]} + /> + {/* { + Tankopedia.mutate((draft) => { + draft.disturbed = true; + draft.requestedDisplay = Number(value); + }); + }} + > + + +
+ + + + + +
+ +
+
+
+ + +
+ +
+
+
+ */} - {fullScreenAvailable && ( - { - if (isFullScreen) { - document.exitFullscreen(); - } else document.body.requestFullscreen(); - }} - color={isFullScreen ? undefined : "gray"} - variant={isFullScreen ? "solid" : "surface"} - > - {isFullScreen ? ( - - ) : ( - - )} - - )} - - )} - - - - { - Tankopedia.mutate((draft) => { - draft.disturbed = true; - draft.requestedDisplay = Number(value); - }); - }} + {requestedDisplay === TankopediaDisplay.DynamicArmor && ( + - - - - - - - - - - - - - - - - - - - - - - + + + - {requestedDisplay === TankopediaDisplay.DynamicArmor && ( - - - - + + + {strings.website.common.tank_search.select_dialog_title} + - - - {strings.website.common.tank_search.select_dialog_title} - + + { + Tankopedia.mutate((draft) => { + draft.antagonist.tank = tank.id; + draft.antagonist.engine = tank.engines.at(-1)!.id; + draft.antagonist.track = tank.tracks.at(-1)!.id; - - { - Tankopedia.mutate((draft) => { - draft.antagonist.tank = tank.id; - draft.antagonist.engine = tank.engines.at(-1)!.id; - draft.antagonist.track = tank.tracks.at(-1)!.id; + const turret = tank.turrets.at(-1)!; + const gun = turret.guns.at(-1)!; - const turret = tank.turrets.at(-1)!; - const gun = turret.guns.at(-1)!; - - draft.antagonist.turret = turret.id; - draft.antagonist.gun = gun.id; - draft.antagonist.shell = gun.shells[0].id; - }); - setAntagonistSelectorOpen(false); - }} - /> - - - - )} - - */} - + draft.antagonist.turret = turret.id; + draft.antagonist.gun = gun.id; + draft.antagonist.shell = gun.shells[0].id; + }); + setAntagonistSelectorOpen(false); + }} + /> + + + + )} +
+
); } diff --git a/packages/website/src/components/TankopediaSandbox/index.tsx b/packages/website/src/components/TankopediaSandbox/index.tsx index 710cc4b22..281141c20 100644 --- a/packages/website/src/components/TankopediaSandbox/index.tsx +++ b/packages/website/src/components/TankopediaSandbox/index.tsx @@ -23,6 +23,7 @@ import { SmartCanvas } from "../SmartCanvas"; import { StaticArmor, type ThicknessRange } from "../StaticArmor"; import { TankModel } from "../TankModel"; import { TankopediaAntagonistControl } from "../TankopediaAntagonistControl"; +import { TankopediaOptions } from "../TankopediaOptions"; import { TankopediaSkinSwitcher } from "../TankopediaSkinSwitcher"; import styles from "./index.module.css"; @@ -178,6 +179,7 @@ export function TankopediaSandbox({ +
); }