fix: change blitzkit icons to big icons

This commit is contained in:
TrèsAbhi committed 2025-09-29 13:41:52 -05:00
1 parent b8c8528e1c
commit d60551d30a
2 files changed
+18 -18

No files matched your search

@@ -1,11 +1,11 @@
import { BLITZKIT_TANK_ICON_SIZE, fetchTankDefinitions } from '@blitzkit/core';
import { launch } from 'puppeteer';
import sharp from 'sharp';
import { commitAssets } from '../core/github/commitAssets';
import { FileChange } from '../core/github/commitMultipleFiles';
import { BLITZKIT_TANK_ICON_SIZE, fetchTankDefinitions } from "@blitzkit/core";
import { launch } from "puppeteer";
import sharp from "sharp";
import { commitAssets } from "../core/github/commitAssets";
import { FileChange } from "../core/github/commitMultipleFiles";
export async function blitzkitTankIcons() {
console.log('Building blitzkit tank icons...');
console.log("Building blitzkit tank icons...");
const browser = await launch();
const page = await browser.newPage();
@@ -21,7 +21,7 @@ export async function blitzkitTankIcons() {
try {
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
waitUntil: 'networkidle0',
waitUntil: "networkidle0",
});
} catch (error) {
console.error(`${id} ${name} time out`, error);
@@ -29,21 +29,21 @@ export async function blitzkitTankIcons() {
}
const screenshot = await page.screenshot({
type: 'webp',
type: "webp",
omitBackground: true,
});
const content = await sharp(screenshot).trim({ threshold: 100 }).toBuffer();
index++;
console.log(
`Rendered ${id} (${name}) ${((index / tanks.length) * 100).toFixed(2)}%`,
`Rendered ${id} (${name}) ${((index / tanks.length) * 100).toFixed(2)}%`
);
files.push({ path: `icons/tanks/blitzkit/${id}.webp`, content });
files.push({ path: `icons/tanks/big/${id}.webp`, content });
}
await page.close();
await browser.close();
await commitAssets('tank icons', files);
await commitAssets("tank icons", files);
}
@@ -1,8 +1,8 @@
import { asset } from '@blitzkit/core';
import { Flex, type FlexProps, Progress } from '@radix-ui/themes';
import { useProgress } from '@react-three/drei';
import { asset } from "@blitzkit/core";
import { Flex, type FlexProps, Progress } from "@radix-ui/themes";
import { useProgress } from "@react-three/drei";
type TankSandboxLoaderProps = Omit<FlexProps, 'id'> & {
type TankSandboxLoaderProps = Omit<FlexProps, "id"> & {
id: number;
};
@@ -12,13 +12,13 @@ export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) {
return (
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
<img
src={asset(`icons/tanks/blitzkit/${id}.webp`)}
style={{ height: '75%', filter: 'blur(1rem)' }}
src={asset(`icons/tanks/big/${id}.webp`)}
style={{ height: "75%", filter: "blur(1rem)" }}
/>
<Progress
size="3"
value={data.progress}
style={{ position: 'absolute', width: '16rem', maxWidth: '50vw' }}
style={{ position: "absolute", width: "16rem", maxWidth: "50vw" }}
/>
</Flex>
);