mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 11:39:51 +01:00
feat: icons
This commit is contained in:
1 parent
a98f0e84d5
commit
d64f04b2c8
8 files changed
+40
-4
No files matched your search
@@ -20,6 +20,10 @@ export default defineConfig({
|
|||||||
outDir: '../../dist/website',
|
outDir: '../../dist/website',
|
||||||
prefetch: true,
|
prefetch: true,
|
||||||
|
|
||||||
|
build: {
|
||||||
|
concurrency: 4,
|
||||||
|
},
|
||||||
|
|
||||||
integrations: [react(), sitemap()],
|
integrations: [react(), sitemap()],
|
||||||
vite: {
|
vite: {
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ interface SlugsTableProps {
|
|||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_UNEXPANDED = 5;
|
const MAX_UNEXPANDED = 3;
|
||||||
|
|
||||||
export function SlugsTable({ slugs, path }: SlugsTableProps) {
|
export function SlugsTable({ slugs, path }: SlugsTableProps) {
|
||||||
if (slugs === undefined) return null;
|
if (slugs === undefined) return null;
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ const glossary = await fetchGlossary(DEFAULT_LOCALE);
|
|||||||
* Returns an in-game avatar image. Use gallery/list.json to get all valid ids.
|
* Returns an in-game avatar image. Use gallery/list.json to get all valid ids.
|
||||||
* Some images may be animated. Not all images share the same dimensions.
|
* Some images may be animated. Not all images share the same dimensions.
|
||||||
*
|
*
|
||||||
* @warning Not all ids have images due to poor Wargaming CDN.
|
* @warning Not all ids have images due to lousy Wargaming CDN.
|
||||||
* @param avatar The avatar id.
|
* @param avatar The avatar id.
|
||||||
* @returns A webp image.
|
* @returns WEBP.
|
||||||
*/
|
*/
|
||||||
export const GET: APIRoute<{}, { avatar: string }> = async ({ params }) => {
|
export const GET: APIRoute<{}, { avatar: string }> = async ({ params }) => {
|
||||||
const image =
|
const image =
|
||||||
|
|||||||
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
|||||||
|
import { asset } from '@blitzkit/core';
|
||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
|
||||||
|
export { getStaticPaths } from '../meta.json';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the big icon for a tank, the image that appears in the tank carousal in the garage. Use tanks/list.json for all valid ids.
|
||||||
|
*
|
||||||
|
* @param id The tank id.
|
||||||
|
* @returns PNG.
|
||||||
|
*/
|
||||||
|
export const GET: APIRoute<{}, { id: string }> = async ({ params }) => {
|
||||||
|
const response = await fetch(asset(`tanks/${params.id}/icons/big.png`));
|
||||||
|
const blob = await response.blob();
|
||||||
|
return new Response(blob, { headers: response.headers });
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { asset } from '@blitzkit/core';
|
||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
|
||||||
|
export { getStaticPaths } from '../meta.json';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the small icon for a tank, the image that appears in the team list in a battle or the loading screen. Use tanks/list.json for all valid ids.
|
||||||
|
*
|
||||||
|
* @param id The tank id.
|
||||||
|
* @returns PNG.
|
||||||
|
*/
|
||||||
|
export const GET: APIRoute<{}, { id: string }> = async ({ params }) => {
|
||||||
|
const response = await fetch(asset(`tanks/${params.id}/icons/small.png`));
|
||||||
|
const blob = await response.blob();
|
||||||
|
return new Response(blob, { headers: response.headers });
|
||||||
|
};
|
||||||
File renamed without changes.
@@ -4,7 +4,7 @@ import type { APIRoute } from 'astro';
|
|||||||
/**
|
/**
|
||||||
* Returns meta data similar to tanks/[id].json but for all tanks as an array. There is no guarantee of order.
|
* Returns meta data similar to tanks/[id].json but for all tanks as an array. There is no guarantee of order.
|
||||||
*
|
*
|
||||||
* @warning This is a large response. Consider using tanks/[id].json for individual tanks.
|
* @warning This is a large response. Consider using tanks/[id]/meta.json for individual tanks.
|
||||||
* @returns JSON.
|
* @returns JSON.
|
||||||
*/
|
*/
|
||||||
export const GET: APIRoute = async () => {
|
export const GET: APIRoute = async () => {
|
||||||
|
|||||||
Reference in new issue
Block a user