Files
blitzkit/packages/website/src/pages/[...locale]/index.astro
T

121 lines
3.3 KiB
Plaintext
Raw Normal View History

2024-09-14 12:18:30 -05:00
---
2024-12-29 20:19:51 -06:00
import {
assertSecret,
DEFAULT_LOCALE,
SUPPORTED_LOCALES,
} from '@blitzkit/core';
2025-01-10 14:37:29 -06:00
import { Box, Flex, Heading } from '@radix-ui/themes';
2024-12-27 12:38:38 -06:00
import type { GetStaticPaths } from 'astro';
import { AesonPlug } from '../../components/AesonPlug';
import HomeHero from '../../components/HomeHero.astro';
import { HomePageHotTanks } from '../../components/HomePageHotTanks';
2025-01-10 14:37:29 -06:00
import { LocaleSwitcher } from '../../components/LocaleSwitcher';
2024-12-27 12:38:38 -06:00
import { Plugs } from '../../components/Plugs';
import ToolCard from '../../components/ToolCard.astro';
2024-09-14 13:24:24 -05:00
import {
compareTool,
discordTool,
2024-10-26 13:58:20 -05:00
embedTool,
2024-10-24 17:05:46 -05:00
galleryTool,
2024-09-14 13:24:24 -05:00
moreTool,
2024-10-12 22:07:59 -05:00
performanceTool,
2024-09-14 13:24:24 -05:00
sessionTool,
tankopediaTool,
2024-11-15 10:55:23 -06:00
tierListTool,
2024-12-27 12:38:38 -06:00
} from '../../constants/tools';
2025-01-06 20:09:11 -06:00
import { getStrings } from '../../core/i18n/getStrings';
2024-12-27 12:38:38 -06:00
import BaseLayout from '../../layouts/BaseLayout.astro';
2024-11-22 10:50:35 -06:00
2025-01-10 13:49:28 -06:00
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
const MODE = assertSecret(import.meta.env.MODE);
2025-01-06 20:09:11 -06:00
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
const strings = getStrings(Astro.params.locale);
2024-12-27 12:38:38 -06:00
export const getStaticPaths = (() => {
return [
2025-01-10 20:38:28 -06:00
...SUPPORTED_LOCALES.filter((locale) => locale !== DEFAULT_LOCALE).map(
(locale) => ({ params: { locale } }),
),
2024-12-27 12:38:38 -06:00
{ params: { locale: undefined } },
];
}) satisfies GetStaticPaths;
2024-09-14 13:24:24 -05:00
---
2024-09-14 12:18:30 -05:00
2024-10-12 22:07:59 -05:00
<BaseLayout>
2024-09-14 19:43:14 -05:00
<HomeHero />
2024-09-14 12:18:30 -05:00
2025-01-10 14:37:29 -06:00
<LocaleSwitcher {locale} client:load />
2024-12-29 20:19:51 -06:00
2024-10-13 00:26:38 -05:00
<Plugs client:idle />
2024-09-14 13:24:24 -05:00
2024-11-22 10:50:35 -06:00
{
2025-01-10 13:49:28 -06:00
PUBLIC_ASSET_BRANCH === 'preview' && (
2024-11-22 10:50:35 -06:00
<Flex justify="center" my="8" px="4">
<AesonPlug />
</Flex>
)
}
2024-10-20 01:01:54 -05:00
<Flex p="4" justify="center" gap="4" mt="3">
2024-09-14 19:43:14 -05:00
<Flex maxWidth="64rem" flexGrow="1" gap="4" direction="column">
<ToolCard tool={tankopediaTool} />
2024-09-14 13:24:24 -05:00
2025-01-10 13:49:28 -06:00
{
(PUBLIC_ASSET_BRANCH === 'main' || MODE === 'development') && (
<HomePageHotTanks {locale} />
)
}
2024-11-10 22:59:34 -06:00
2024-10-10 16:08:35 -05:00
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
{/* <ToolCard tool={playerStatsTool} /> */}
<ToolCard tool={compareTool} />
2024-10-12 22:07:59 -05:00
<ToolCard tool={performanceTool} />
2024-10-10 16:08:35 -05:00
</Flex>
2024-09-14 19:43:14 -05:00
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
2024-12-26 13:47:51 -06:00
<!-- <ToolCard tool={chartsTool} /> -->
2024-10-24 17:05:46 -05:00
<ToolCard tool={galleryTool} />
2024-09-14 19:43:14 -05:00
<ToolCard tool={sessionTool} />
2024-12-26 13:47:51 -06:00
</Flex>
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
2024-12-12 15:07:39 -06:00
<ToolCard tool={discordTool} />
2024-12-22 20:34:16 -06:00
<ToolCard tool={tierListTool} />
</Flex>
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
2024-12-26 13:47:51 -06:00
<ToolCard tool={embedTool} />
2024-09-14 19:43:14 -05:00
<ToolCard tool={moreTool} />
2024-12-26 13:47:51 -06:00
</Flex>
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
2024-12-22 20:34:16 -06:00
<Box flexGrow="1" />
2024-09-14 19:43:14 -05:00
</Flex>
2024-09-14 13:24:24 -05:00
2025-01-06 20:09:11 -06:00
<Heading align="center" mt="6"
>{strings.website.home.other_projects.title}</Heading
>
2024-09-14 13:24:24 -05:00
2024-10-10 16:25:05 -05:00
<Flex gap="4" mb="6" direction={{ initial: 'column', sm: 'row' }}>
2024-09-14 19:43:14 -05:00
<ToolCard
tool={{
2025-01-06 20:09:11 -06:00
button: { color: 'blue' },
id: 'blitz_analysis',
2024-09-14 19:43:14 -05:00
image: 'j76YXGl',
href: 'https://blitzanalysiz.com/',
}}
/>
<ToolCard
tool={{
2025-01-06 20:09:11 -06:00
button: { color: 'purple', highContrast: true },
2024-09-14 19:43:14 -05:00
image: 'zYrrYbR',
2025-01-06 20:09:11 -06:00
id: 'blitz_insider',
2024-09-14 19:43:14 -05:00
href: 'https://discord.gg/UjWf9eGgtR',
}}
/>
2024-09-14 13:24:24 -05:00
</Flex>
</Flex>
2024-09-14 19:43:14 -05:00
</Flex>
2024-09-14 13:24:24 -05:00
2024-09-14 19:43:14 -05:00
<div style={{ flex: 1 }}></div>
2024-10-12 22:07:59 -05:00
</BaseLayout>