feat: adding background to item

This commit is contained in:
Hydra
2024-05-03 19:51:13 +01:00
parent f6072eeb5c
commit 1f2f269736
20 changed files with 77 additions and 98 deletions

View File

@@ -74,12 +74,15 @@ export const getSteamAppAsset = (
return `https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/${objectID}/${clientIcon}.ico`;
};
export const getImageBase64 = async (url: string) =>
export const getFileBuffer = async (url: string) =>
fetch(url, { method: "GET" }).then((response) =>
response.arrayBuffer().then((buffer) => {
return `data:image/jpeg;base64,${Buffer.from(buffer).toString("base64")}`;
})
response.arrayBuffer().then((buffer) => Buffer.from(buffer))
);
export const getImageBase64 = async (url: string) =>
getFileBuffer(url).then((buffer) => {
return `data:image/jpeg;base64,${Buffer.from(buffer).toString("base64")}`;
});
export * from "./formatters";
export * from "./ps";