feat: start on api

This commit is contained in:
TrèsAbhi committed 2025-09-13 23:07:58 -05:00
1 parent d15a5aee69
commit 96a8f225fc
6 files changed
+19 -65

No files matched your search

+6
View File
@@ -1445,6 +1445,12 @@
"button": "Get started",
"description": "Get started with BlitzKit",
"seo_description": "Get started with BlitzKit"
},
"api": {
"name": "API",
"button": "To the docs",
"description": "BlitzKit hosted API",
"seo_description": "BlitzKit hosted static API for World of Tanks Blitz"
}
},
Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

+7 -2
View File
@@ -10,7 +10,7 @@ export interface Tool {
href?: string;
}
export const tools: Record<string, Tool> = {
export const tools = {
tanks: {
id: "tanks",
strings: "tankopedia",
@@ -66,9 +66,14 @@ export const tools: Record<string, Tool> = {
id: "embed",
button: "red",
},
api: {
id: "api",
disabled: true,
button: "bronze",
},
more: {
id: "more",
href: "https://discord.gg/nDt7AjGJQH",
button: "plum",
},
};
} satisfies Record<string, Tool>;
@@ -0,0 +1,6 @@
---
import { tools } from "../../constants/tools";
import ToolLayout from "../../layouts/ToolLayout.astro";
---
<ToolLayout tool={tools.api}></ToolLayout>
@@ -1,33 +0,0 @@
import { TankSandbox } from "../../../../../components/Tankopedia/HeroSection/components/TankSandbox";
import { awaitableModelDefinitions } from "../../../../../core/awaitables/modelDefinitions";
import { awaitableTankDefinitions } from "../../../../../core/awaitables/tankDefinitions";
import { LocaleProvider } from "../../../../../hooks/useLocale";
import { Duel } from "../../../../../stores/duel";
import { Tankopedia } from "../../../../../stores/tankopedia";
const [tankDefinitions, modelDefinitions] = await Promise.all([
awaitableTankDefinitions,
awaitableModelDefinitions,
]);
interface PageProps {
id: number;
}
export function Page({ id }: PageProps) {
const tank = tankDefinitions.tanks[id];
const model = modelDefinitions.models[id];
Tankopedia.useInitialization(model);
Duel.useInitialization({ tank, model });
return (
<LocaleProvider locale="en">
<Content />
</LocaleProvider>
);
}
function Content() {
return <TankSandbox naked thicknessRange={{ value: 0 }} />;
}
@@ -1,30 +0,0 @@
---
import { assertSecret } from '@blitzkit/core';
import type { GetStaticPaths } from 'astro';
import { getStaticPaths as tankopediaGetStaticPaths } from '../../../../[...locale]/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;
---
<html>
<head>
<style is:global>
body {
margin: 0;
}
</style>
</head>
<body>
<Page {id} client:load />
</body>
</html>