diff --git a/bun.lockb b/bun.lockb index 8f11b0168..543a1e060 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 81c900bc9..ba11ded57 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -861,6 +861,16 @@ "tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)", "tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.", + "visualizers": { + "rotator": { + "hull": "Hull", + "turret": "Turret", + "hard": "Hard", + "medium": "Medium", + "soft": "Soft" + } + }, + "sandbox": { "poses": { "hull_down": "Hull down", diff --git a/packages/website/package.json b/packages/website/package.json index d3602e71d..60e935362 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -29,6 +29,7 @@ "js-cookie": "^3.0.5", "markdown-to-jsx": "^7.5.0", "nanostores": "^0.11.3", + "quicklime": "^1.2.0", "react": "^18.3.1", "react-device-detect": "^2.2.3", "react-dom": "^18.3.1", diff --git a/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/hull.png b/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/hull.png new file mode 100644 index 000000000..2796c2741 Binary files /dev/null and b/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/hull.png differ diff --git a/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/turret.png b/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/turret.png new file mode 100644 index 000000000..734031ee5 Binary files /dev/null and b/packages/website/public/assets/images/tankopedia/visualizers/hull-traverse/turret.png differ diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.css b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.css new file mode 100644 index 000000000..4199ac3b9 --- /dev/null +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.css @@ -0,0 +1,13 @@ +@keyframes spin { + from { + transform: translate(-50%, -50%) rotate(0deg); + } + + to { + transform: translate(-50%, -50%) rotate(360deg); + } +} + +.hull-traverse-visualizer { + animation: spin linear infinite; +} diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.tsx new file mode 100644 index 000000000..6fd7c1276 --- /dev/null +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/HullTraverseVisualizer/index.tsx @@ -0,0 +1,133 @@ +import { Card, Checkbox, Flex, Tabs, Text } from '@radix-ui/themes'; +import { useRef, useState } from 'react'; +import type { TankCharacteristics } from '../../../../../../../core/blitzkit/tankCharacteristics'; +import { useLocale } from '../../../../../../../hooks/useLocale'; +import './index.css'; + +interface HullTraverseVisualizerProps { + stats: TankCharacteristics; +} + +interface HullTraverseVisualizerEventData { + hull: boolean; + turret: boolean; +} + +type Terrain = 'Hard' | 'Medium' | 'Soft'; + +export function HullTraverseVisualizer({ stats }: HullTraverseVisualizerProps) { + const hull = useRef(null); + const turret = useRef(null); + const [terrain, setTerrain] = useState('Hard'); + const [rotateHull, setRotateHull] = useState(true); + const [rotateTurret, setRotateTurret] = useState(true); + const { strings } = useLocale(); + + return ( + +
+ + + +
+ + + setTerrain(terrain as Terrain)} + > + + + {strings.website.tools.tankopedia.visualizers.rotator.hard} + + + {strings.website.tools.tankopedia.visualizers.rotator.medium} + + + {strings.website.tools.tankopedia.visualizers.rotator.soft} + + + + + + + setRotateHull((state) => !state)} + style={{ cursor: 'pointer' }} + > + + + {strings.website.tools.tankopedia.visualizers.rotator.hull} + + + + setRotateTurret((state) => !state)} + style={{ cursor: 'pointer' }} + > + + + {strings.website.tools.tankopedia.visualizers.rotator.turret} + + + +
+ ); +} diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/index.tsx index e7636fb0b..c43db8686 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/index.tsx @@ -31,6 +31,7 @@ import { useLocale } from '../../../../../hooks/useLocale'; import { useTankModelDefinition } from '../../../../../hooks/useTankModelDefinition'; import { Duel } from '../../../../../stores/duel'; import { TankopediaEphemeral } from '../../../../../stores/tankopediaEphemeral'; +import { HullTraverseVisualizer } from './components/HullTraverseVisualizer'; import { Info } from './components/Info'; import { InfoWithDelta } from './components/InfoWithDelta'; @@ -753,6 +754,8 @@ export function Characteristics() { indent value="hullTraverseSoftTerrain" /> + +