diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx index 75e173ea4..0b6403752 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx @@ -35,7 +35,11 @@ const ARCADE_MODE_DISTANCE = 19; const ARCADE_MODE_ANGLE = degToRad(10); const ARCADE_MODE_FOV = 54; -export function Controls() { +interface ControlsProps { + naked?: boolean; +} + +export function Controls({ naked }: ControlsProps) { const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation(); const display = TankopediaEphemeral.use((state) => state.display); const duelStore = Duel.useStore(); @@ -82,7 +86,7 @@ export function Controls() { antagonistModelDefinition.turret_origin.y + antagonistTurretModelDefinition.gun_origin.y; const [autoRotate, setAutoRotate] = useState( - display !== TankopediaDisplay.ShootingRange, + display !== TankopediaDisplay.ShootingRange && !naked, ); const gunHeight = protagonistHullOrigin.y + diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx index 0c920375c..511d3c09c 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx @@ -31,10 +31,11 @@ import { TankModel } from './components/TankModel'; interface TankSandboxProps { thicknessRange: ThicknessRange; + naked?: boolean; } export const TankSandbox = forwardRef( - ({ thicknessRange }, ref) => { + ({ thicknessRange, naked }, ref) => { const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation(); const canvas = useRef(null); const hasImprovedVerticalStabilizer = useEquipment(122); @@ -179,10 +180,15 @@ export const TankSandbox = forwardRef( draft.highlightArmor = undefined; }); }} - style={{ userSelect: 'none' }} + style={{ + userSelect: 'none', + width: naked ? 640 : '100%', + height: naked ? 480 : '100%', + outline: naked ? '1rem red solid' : undefined, + }} > - - + + {!naked && } {display !== TankopediaDisplay.StaticArmor && } diff --git a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx new file mode 100644 index 000000000..213149ea1 --- /dev/null +++ b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/_index.tsx @@ -0,0 +1,40 @@ +import { TankSandbox } from '../../../../../components/Tankopedia/HeroSection/components/TankSandbox'; +import { awaitableModelDefinitions } from '../../../../../core/awaitables/modelDefinitions'; +import { awaitableProvisionDefinitions } from '../../../../../core/awaitables/provisionDefinitions'; +import { awaitableTankDefinitions } from '../../../../../core/awaitables/tankDefinitions'; +import { App } from '../../../../../stores/app'; +import { Duel } from '../../../../../stores/duel'; +import { TankopediaEphemeral } from '../../../../../stores/tankopediaEphemeral'; +import { TankopediaPersistent } from '../../../../../stores/tankopediaPersistent'; + +const [provisionDefinitions, tankDefinitions, modelDefinitions] = + await Promise.all([ + awaitableProvisionDefinitions, + awaitableTankDefinitions, + awaitableModelDefinitions, + ]); + +interface PageProps { + id: number; +} + +export function Page({ id }: PageProps) { + const tank = tankDefinitions.tanks[id]; + const model = modelDefinitions.models[id]; + + return ( + + + + + + + + + + ); +} + +function Content() { + return ; +} diff --git a/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro new file mode 100644 index 000000000..7aa817f2b --- /dev/null +++ b/packages/website/src/pages/api/tankopedia/tank-icon/[id]/index.astro @@ -0,0 +1,30 @@ +--- +import { assertSecret } from '@blitzkit/core'; +import type { GetStaticPaths } from 'astro'; +import { getStaticPaths as tankopediaGetStaticPaths } from '../../../../tools/tankopedia/[id]/index.astro'; +import { Page } from './_index'; + +export const getStaticPaths = (async () => { + if (assertSecret(import.meta.env.MODE) === 'development') { + return await tankopediaGetStaticPaths(); + } else { + return []; + } +}) satisfies GetStaticPaths; + +const { id } = Astro.params; +--- + + + + + + + + + +