diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx index 10e294607..0bd8312a2 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx @@ -32,7 +32,7 @@ export function Info({ style={{ width: '100%', paddingLeft: indent ? 24 : 0 }} gap="4" > - + {name} {unit != undefined && ( <> diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx index 00e62ee1b..49f89d61d 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx @@ -25,12 +25,14 @@ import { } from '../../../../../../core/blitzkit/tankDefinitions/constants'; import { useEquipment } from '../../../../../../hooks/useEquipment'; import { useFullScreen } from '../../../../../../hooks/useFullScreen'; +import { useWideFormat } from '../../../../../../hooks/useWideFormat'; import { mutateDuel, useDuel } from '../../../../../../stores/duel'; import { useTankopediaTemporary } from '../../../../../../stores/tankopedia'; import { Info } from './components/Info'; import { InfoWithDelta } from './components/InfoWithDelta'; export function Characteristics() { + const wideFormat = useWideFormat(960); const awaitedEquipmentDefinitions = use(equipmentDefinitions); const awaitedModelDefinitions = use(modelDefinitions); const awaitedProvisionDefinitions = use(provisionDefinitions); @@ -128,445 +130,450 @@ export function Characteristics() { if (isFullScreen) return null; return ( - - - - Fire + + + + + Fire - - {gun.shells.map((thisShell, shellIndex) => ( - { - mutateDuel((draft) => { - draft.protagonist!.shell = thisShell; - }); - }} - > - - - ))} - - - {GUN_TYPE_NAMES[gun.type]} - - {stats.dpm} - - {gun.type === 'autoReloader' && ( - <> - - {stats.dpmMaximum!} - - - {stats.dpmEffective!} - - + {gun.shells.map((thisShell, shellIndex) => ( + { + mutateDuel((draft) => { + draft.protagonist!.shell = thisShell; + }); + }} > - What's the difference? - - } - /> - - )} - {gun.type !== 'regular' && ( - {stats.shells} - )} - {gun.type === 'autoReloader' ? ( - <> - - {stats.mostOptimalShellIndex} - - - {stats.shellReloads!.map((reload, index) => ( - - {reload} + + + ))} + + + {GUN_TYPE_NAMES[gun.type]} + + {stats.dpm} + + {gun.type === 'autoReloader' && ( + <> + + {stats.dpmMaximum!} - ))} - - ) : ( - - {stats.shellReload!} - - )} - {(gun.type === 'autoLoader' || gun.type === 'autoReloader') && ( - - {stats.intraClip!} - - )} - - {stats.penetration} - - {typeof shell.penetration !== 'number' && ( - <> + + {stats.dpmEffective!} + + + What's the difference? + + } + /> + + )} + {gun.type !== 'regular' && ( + {stats.shells} + )} + {gun.type === 'autoReloader' ? ( + <> + + {stats.mostOptimalShellIndex} + + + {stats.shellReloads!.map((reload, index) => ( + + {reload} + + ))} + + ) : ( + + {stats.shellReload!} + + )} + {(gun.type === 'autoLoader' || gun.type === 'autoReloader') && ( - {lerp( - shell.penetration[0], - shell.penetration[1], - (penetrationDistance * penetrationLossOverDistanceCoefficient) / - 500, - ) * penetrationCoefficient} + {stats.intraClip!} - - Distance - { - setPenetrationDistance(value); - }, 500)} - /> - { - setPenetrationDistance( - Math.min( - parseInt(penetrationDistanceInput.current!.value), - 500, - ), - ); - }} - onKeyDown={(event) => { - if (event.key === 'Enter') { - event.currentTarget.blur(); - } - }} - > - m - - - - )} - - {stats.damage} - - - {stats.moduleDamage} - - {isExplosive(shell.type) && ( - - {stats.explosionRadius!} + )} + + {stats.penetration} - )} - - {stats.caliber} - - - {stats.shellNormalization} - - {shell.type !== 'he' && ( - - {stats.shellRicochet!} - - )} - - {stats.shellVelocity} - - - {stats.aimTime} - - - - {stats.dispersion} - - - {stats.dispersionMoving} - - - {stats.dispersionHullTraversing} - - - {stats.dispersionTurretTraversing} - - - {stats.dispersionShooting} - - - {stats.dispersionGunDamaged} - - - - {stats.gunDepression} - - - {stats.gunElevation} - - {gunModelDefinition.pitch.front && ( - <> - - {stats.gunFrontalDepression!} - - - {stats.gunFrontalElevation!} - - - )} - {gunModelDefinition.pitch.back && ( - <> - - {stats.gunRearDepression!} - - - {stats.gunRearElevation!} - - - )} - {turretModelDefinition.yaw && ( - <> - - {stats.azimuthLeft!} - - - {stats.azimuthRight!} - - - )} - - - - Maneuverability - - - {stats.speedForwards} - - - {stats.speedBackwards} - - - {stats.enginePower} - - - {stats.weight} - - - - {stats.powerToWeightRatioHardTerrain} - - - {stats.powerToWeightRatioMediumTerrain} - - - {stats.powerToWeightRatioSoftTerrain} - - - {stats.turretTraverseSpeed} - - - - {stats.hullTraverseHardTerrain} - - - {stats.hullTraverseMediumTerrain} - - - {stats.hullTraverseSoftTerrain} - - - - - Survivability - - {stats.health} - - - {stats.fireChance * 100} - - - {stats.viewRange} - - - - {stats.camouflageStill * 100} - - - {stats.camouflageMoving * 100} - - - {stats.camouflageShootingStill * 100} - - - {stats.camouflageShootingMoving * 100} - - - {stats.camouflageCaughtOnFire * 100} - - - {stats.width} - - - {stats.height} - - - {stats.length} - - - {stats.volume} - - - - - - Crew training - - - - - - - - - - - - represents the other roles a crew member can take. - - - - - - {tank.crew.map((member) => { - const count = member.count ?? 1; - - return ( - + {typeof shell.penetration !== 'number' && ( + <> 1 ? ` x ${count}` : ''}`} - unit="%" + indent decimals={0} + name={`At ${penetrationDistance}m`} > - {(member.type === 'commander' - ? commanderMastery - : crewMemberMastery) * 100} + {lerp( + shell.penetration[0], + shell.penetration[1], + (penetrationDistance * + penetrationLossOverDistanceCoefficient) / + 500, + ) * penetrationCoefficient} - {member.substitute && ( - - - - {member.substitute - .map((sub, index) => - index === 0 ? CREW_MEMBER_NAMES[sub] : sub, - ) - .join(', ')} - - - } + + Distance + { + setPenetrationDistance(value); + }, 500)} /> - )} - - ); - })} + { + setPenetrationDistance( + Math.min( + parseInt(penetrationDistanceInput.current!.value), + 500, + ), + ); + }} + onKeyDown={(event) => { + if (event.key === 'Enter') { + event.currentTarget.blur(); + } + }} + > + m + + + + )} + + {stats.damage} + + + {stats.moduleDamage} + + {isExplosive(shell.type) && ( + + {stats.explosionRadius!} + + )} + + {stats.caliber} + + + {stats.shellNormalization} + + {shell.type !== 'he' && ( + + {stats.shellRicochet!} + + )} + + {stats.shellVelocity} + + + {stats.aimTime} + + + + {stats.dispersion} + + + {stats.dispersionMoving} + + + {stats.dispersionHullTraversing} + + + {stats.dispersionTurretTraversing} + + + {stats.dispersionShooting} + + + {stats.dispersionGunDamaged} + + + + {stats.gunDepression} + + + {stats.gunElevation} + + {gunModelDefinition.pitch.front && ( + <> + + {stats.gunFrontalDepression!} + + + {stats.gunFrontalElevation!} + + + )} + {gunModelDefinition.pitch.back && ( + <> + + {stats.gunRearDepression!} + + + {stats.gunRearElevation!} + + + )} + {turretModelDefinition.yaw && ( + <> + + {stats.azimuthLeft!} + + + {stats.azimuthRight!} + + + )} + + + + Crew training + + + + + + + + + + + + + represents the other roles a crew member can take. + + + + + + + {tank.crew.map((member) => { + const count = member.count ?? 1; + + return ( + + 1 ? ` x ${count}` : ''}`} + unit="%" + decimals={0} + > + {(member.type === 'commander' + ? commanderMastery + : crewMemberMastery) * 100} + + {member.substitute && ( + + + + {member.substitute + .map((sub, index) => + index === 0 ? CREW_MEMBER_NAMES[sub] : sub, + ) + .join(', ')} + + + } + /> + )} + + ); + })} + + + + + + Maneuverability + + + {stats.speedForwards} + + + {stats.speedBackwards} + + + {stats.enginePower} + + + {stats.weight} + + + + {stats.powerToWeightRatioHardTerrain} + + + {stats.powerToWeightRatioMediumTerrain} + + + {stats.powerToWeightRatioSoftTerrain} + + + {stats.turretTraverseSpeed} + + + + {stats.hullTraverseHardTerrain} + + + {stats.hullTraverseMediumTerrain} + + + {stats.hullTraverseSoftTerrain} + + + + Survivability + + {stats.health} + + + {stats.fireChance * 100} + + + {stats.viewRange} + + + + {stats.camouflageStill * 100} + + + {stats.camouflageMoving * 100} + + + {stats.camouflageShootingStill * 100} + + + {stats.camouflageShootingMoving * 100} + + + {stats.camouflageCaughtOnFire * 100} + + + {stats.width} + + + {stats.height} + + + {stats.length} + + + {stats.volume} + + ); diff --git a/src/app/tools/tankopedia/[id]/components/Model/CharacteristicsSection.tsx b/src/app/tools/tankopedia/[id]/components/Model/CharacteristicsSection.tsx index 285327f68..0320807b7 100644 --- a/src/app/tools/tankopedia/[id]/components/Model/CharacteristicsSection.tsx +++ b/src/app/tools/tankopedia/[id]/components/Model/CharacteristicsSection.tsx @@ -1,5 +1,4 @@ import { Flex, Heading } from '@radix-ui/themes'; -import PageWrapper from '../../../../../../components/PageWrapper'; import { useWideFormat } from '../../../../../../hooks/useWideFormat'; import { Characteristics } from '../Characteristics'; import { Consumables } from '../Characteristics/components/Consumables'; @@ -10,16 +9,25 @@ import { Provisions } from '../Characteristics/components/Provisions'; import { Skills } from '../Characteristics/components/Skills'; export function CharacteristicsSection() { - const wideFormat = useWideFormat(720); + const wideFormat = useWideFormat(700); return ( - + - + Configure @@ -30,7 +38,11 @@ export function CharacteristicsSection() { @@ -38,6 +50,6 @@ export function CharacteristicsSection() { - + ); } diff --git a/src/app/tools/tankopedia/[id]/components/Model/HeroSection.tsx b/src/app/tools/tankopedia/[id]/components/Model/HeroSection.tsx index 2edc34c6a..496025b10 100644 --- a/src/app/tools/tankopedia/[id]/components/Model/HeroSection.tsx +++ b/src/app/tools/tankopedia/[id]/components/Model/HeroSection.tsx @@ -25,7 +25,7 @@ export function HeroSection() { style={{ background: `linear-gradient(${wideFormat ? -90 : 180}deg, ${theme.colors.appBackground1}, ${theme.colors.appBackground2})`, position: 'relative', - height: wideFormat ? undefined : 'calc(87.5vh - 64px)', + height: wideFormat ? undefined : 'calc(75vh - 64px)', }} gap="4" > diff --git a/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx b/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx index 970c121c6..302fe9389 100644 --- a/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx +++ b/src/app/tools/tankopedia/[id]/components/Model/TechTreeSection.tsx @@ -124,7 +124,12 @@ export function TechTreeSection() { ; }; export default function PageWrapper({ @@ -18,6 +19,7 @@ export default function PageWrapper({ noPadding = false, noMaxWidth = false, highlight = false, + containerProps, ...props }: PageWrapperProps) { return ( @@ -30,7 +32,9 @@ export default function PageWrapper({ background: highlight ? `linear-gradient(-90deg, ${theme.colors.appBackground1}, ${theme.colors.appBackground2})` : undefined, + ...containerProps?.style, }} + {...containerProps} >