mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: added WN8 to /today
This commit is contained in:
1 parent
c5d14758d5
commit
f801783358
14 files changed
+163
-51
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import sumStats from '../blitz/sumStats.js';
|
||||
import { emptyAllStats } from './getTankStatsOverTime.js';
|
||||
import { tankAverages } from './tankAverages.js';
|
||||
|
||||
console.log('Calculating player average...');
|
||||
export const playerAverage = Object.entries(tankAverages).reduce(
|
||||
(accumulator, [, tankAverage]) => {
|
||||
return sumStats([accumulator, tankAverage.all]);
|
||||
},
|
||||
emptyAllStats,
|
||||
);
|
||||
console.log('Calculated player average');
|
||||
File renamed without changes.
@@ -3,7 +3,7 @@ export type TableInput = TableInputEntry[];
|
||||
|
||||
export default function cleanTable(input: TableInput) {
|
||||
return input
|
||||
.filter((array) => array[1] !== `${-Infinity}`)
|
||||
.filter((array) => array[1] !== undefined)
|
||||
.map((array) => (array.length === 0 ? '' : `**${array[0]}**: ${array[1]}`))
|
||||
.join('\n');
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { Resvg } from '@resvg/resvg-js';
|
||||
import { readFile } from 'fs';
|
||||
import { ReactNode } from 'react';
|
||||
import satori from 'satori';
|
||||
import { WRAPPER_SIZE_WIDTHS, WrapperSize } from '../../components/Wrapper.js';
|
||||
|
||||
const FONT_NAME = 'Roboto';
|
||||
const FONT_FILES = ['Roboto', 'Roboto-Bold', 'Roboto-Black'];
|
||||
@@ -20,9 +21,12 @@ const [robotoFlex, robotoFlexBold, robotoFlexBlack] = await Promise.all(
|
||||
);
|
||||
console.log('Fonts imported');
|
||||
|
||||
export default async function render(element: ReactNode) {
|
||||
export default async function render(
|
||||
element: ReactNode,
|
||||
size: WrapperSize = WrapperSize.Regular,
|
||||
) {
|
||||
const svg = await satori(element, {
|
||||
width: 640,
|
||||
width: WRAPPER_SIZE_WIDTHS[size],
|
||||
fonts: [
|
||||
{ data: robotoFlex, name: FONT_NAME, weight: 400 },
|
||||
{ data: robotoFlexBold, name: FONT_NAME, weight: 700 },
|
||||
|
||||
Reference in new issue
Block a user