feat: some ui

This commit is contained in:
TrèsAbhi committed 2024-03-14 17:31:11 -05:00
1 parent 43e1d53d39
commit 476d8e804a
5 files changed
+141 -6

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import sharp from 'sharp';
import { tankIcon } from './tankIcon';
export async function tankIconPng(id: number) {
const imageResponse = await fetch(tankIcon(id));
const imageBufferWEBP = await imageResponse.arrayBuffer();
const imageBufferPNG = await sharp(imageBufferWEBP).png().toBuffer();
return `data:image/png;base64,${imageBufferPNG.toString('base64')}`;
}