diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index e9a1a3265..8c5cfc4f5 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -871,7 +871,8 @@ }, "ricochet": { - "max": "Max: %s1°" + "safe": "Safe %s1°", + "unsafe": "Unsafe %s1°" } }, diff --git a/packages/website/astro.config.mjs b/packages/website/astro.config.mjs index edea82396..45bd1c5dc 100644 --- a/packages/website/astro.config.mjs +++ b/packages/website/astro.config.mjs @@ -1,14 +1,14 @@ // @ts-check -import partytown from "@astrojs/partytown"; -import react from "@astrojs/react"; -import sitemap from "@astrojs/sitemap"; -import { SUPPORTED_LOCALES } from "@blitzkit/i18n"; -import { defineConfig } from "astro/config"; +import partytown from '@astrojs/partytown'; +import react from '@astrojs/react'; +import sitemap from '@astrojs/sitemap'; +import { SUPPORTED_LOCALES } from '@blitzkit/i18n'; +import { defineConfig } from 'astro/config'; export default defineConfig({ i18n: { - defaultLocale: "en", + defaultLocale: 'en', locales: [...SUPPORTED_LOCALES], routing: { prefixDefaultLocale: false, @@ -16,17 +16,17 @@ export default defineConfig({ }, devToolbar: { enabled: false }, - output: "static", - site: "https://blitzkit.app", - outDir: "../../dist/website", + output: 'static', + site: 'https://blitzkit.app', + outDir: '../../dist/website', prefetch: true, integrations: [react(), sitemap(), partytown()], vite: { resolve: { alias: { - ".prisma/client/index-browser": - "../../node_modules/.prisma/client/index-browser.js", + '.prisma/client/index-browser': + '../../node_modules/.prisma/client/index-browser.js', }, }, ssr: { diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer.tsx deleted file mode 100644 index 446349aa1..000000000 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { asset } from '@blitzkit/core'; -import { literals } from '@blitzkit/i18n'; -import { Box, Card, Text } from '@radix-ui/themes'; -import { Var } from '../../../../../../core/radix/var'; -import { useLocale } from '../../../../../../hooks/useLocale'; -import { Duel } from '../../../../../../stores/duel'; -import type { VisualizerProps } from './HullTraverseVisualizer'; - -export function RicochetVisualizer({ stats }: VisualizerProps) { - const ricochet = stats.shellRicochet ?? 90; - const normalization = stats.shellNormalization; - const shell = Duel.use((state) => state.protagonist.shell); - const { strings } = useLocale(); - - return ( - - - - - - - - - - - - - {literals(strings.website.tools.tankopedia.visualizers.ricochet.max, [ - (ricochet + normalization).toFixed(0), - ])} - - - - ); -} diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.css b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.css new file mode 100644 index 000000000..c77ba09de --- /dev/null +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.css @@ -0,0 +1,79 @@ +@keyframes penetrating-shell-slide { + 0% { + margin-top: -9rem; + } + 28%, + 100% { + margin-top: 8rem; + } +} + +@keyframes ricocheting-shell-slide { + 0% { + margin-top: -18rem; + } + 38% { + margin-top: -18rem; + } + 63%, + 69% { + margin-top: 0rem; + } + 100% { + margin-top: 8rem; + } +} + +@keyframes ricocheting-shell-slide-container { + 0% { + transform: translateX(-50%) rotate(80deg); + } + 63% { + transform: translateX(-50%) rotate(80deg); + } + 69% { + transform: translateX(-50%) rotate(100deg); + } + 100% { + transform: translateX(-50%) rotate(100deg); + } +} + +.ricochet-visualizer-penetrating-shell { + position: absolute; + animation: penetrating-shell-slide 3s infinite; +} + +.ricochet-visualizer-ricocheting-shell { + position: absolute; + animation: ricocheting-shell-slide 3s infinite; +} + +.ricochet-visualizer-ricocheting-shell-container { + animation: ricocheting-shell-slide-container 3s infinite; +} + +@keyframes surface-impact { + 0%, + 10% { + opacity: 1; + width: 0; + height: 0; + } + 15%, + 30% { + opacity: 1; + width: 3rem; + height: 3rem; + } + 45%, + 100% { + opacity: 0; + width: 3rem; + height: 3rem; + } +} + +.ricochet-visualizer-surface-impact { + animation: surface-impact 3s infinite; +} diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.tsx new file mode 100644 index 000000000..624034f28 --- /dev/null +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/RicochetVisuazlizer/index.tsx @@ -0,0 +1,198 @@ +import { asset } from '@blitzkit/core'; +import { literals } from '@blitzkit/i18n'; +import { Box, Card, Text } from '@radix-ui/themes'; +import { Var } from '../../../../../../../core/radix/var'; +import { useLocale } from '../../../../../../../hooks/useLocale'; +import { Duel } from '../../../../../../../stores/duel'; +import type { VisualizerProps } from '../HullTraverseVisualizer'; +import './index.css'; + +export function RicochetVisualizer({ stats }: VisualizerProps) { + const ricochet = stats.shellRicochet ?? 90; + const shell = Duel.use((state) => state.protagonist.shell); + const { strings } = useLocale(); + + return ( + + + + + + + + + {/* */} + + + + + + + + + + + + + + + + + {literals( + strings.website.tools.tankopedia.visualizers.ricochet.safe, + [(2 * ricochet).toFixed(0)], + )} + + + + {literals( + strings.website.tools.tankopedia.visualizers.ricochet.unsafe, + [(90 - ricochet).toFixed(0)], + )} + + + + ); +}