Compare commits

...
44 Commits
Author SHA1 Message Date
tresabhi 6d6bae847b feat: crowdin 2024-12-19 11:18:05 -06:00
tresabhi cc70b3ccc3 feat: logs 2024-12-19 11:16:27 -06:00
tresabhi e3bf619808 fix: remove comments 2024-12-19 11:09:32 -06:00
tresabhi f6cb4f2518 more adrenaline 2024-12-19 11:09:13 -06:00
tresabhi f396d6c4a1 fix: use stricter localizaiton 2024-12-19 11:04:48 -06:00
tresabhi 768c420ae4 Merge branch 'main' into dev 2024-12-19 10:41:46 -06:00
TrèsAbhi 7fba197bef Merge pull request #133 from tresabhi/l10n_main
New Crowdin updates
2024-12-19 10:41:26 -06:00
tresabhi b074481e1a fix: performance tool use performance 2024-12-19 10:29:32 -06:00
tresabhi 987e35ef8f feat: sticky headers for performance 2024-12-19 10:28:44 -06:00
tresabhi 83c77b5945 fix: make tank loader icon smaller 2024-12-19 10:20:09 -06:00
tresabhi e4f0120d67 feat: use blitzkit icons by default 2024-12-19 10:19:26 -06:00
tresabhi 2055c00154 Merge branch 'main' into dev 2024-12-17 21:49:58 -06:00
tresabhi c814230dcb feat: better loader 2024-12-17 21:49:55 -06:00
tresabhi 2f31aadb29 feat: better text in header 2024-12-17 21:46:44 -06:00
tresabhi 3113bf3a47 fix: filters 2024-12-17 21:06:11 -06:00
tresabhi 70bd54e03b feat: remove naked lighting 2024-12-17 19:45:48 -06:00
tresabhi 8863ac5fde feat: some icon only lighting 2024-12-17 11:12:04 -06:00
TrèsAbhi b62009ce2b Update Party3.astro 2024-12-17 09:58:49 -06:00
tresabhi 0f3d230f42 feat: better sizing for new icons 2024-12-16 23:42:38 -06:00
tresabhi 9db6b997c3 fix: use tanks key 2024-12-16 22:44:02 -06:00
tresabhi d9fcbd028b fix: re add blitzkit tank icons 2024-12-16 22:42:27 -06:00
tresabhi db74058075 feat: new angle 2024-12-16 22:40:36 -06:00
tresabhi 4180736d37 feat: neater code 2024-12-16 13:32:31 -06:00
tresabhi 382f04229e feat: better icons and sizing 2024-12-16 13:30:35 -06:00
tresabhi 3c9ba9ec53 feat: increased max recently viewed tank count to 14 2024-12-16 13:21:06 -06:00
tresabhi 4848234264 feat: custom tank icons 2024-12-16 12:41:24 -06:00
tresabhi 2ad0fcfdf9 feat: better hdr 2024-12-16 12:24:37 -06:00
tresabhi 8f0894364b fix: remove nitro ads 2024-12-16 11:01:07 -06:00
tresabhi 3695b8f7f4 fix: tag 2024-12-16 10:59:26 -06:00
tresabhi 4f8c1d416f feat: delete rando 2024-12-16 10:50:52 -06:00
tresabhi 453286677a Merge branch 'l10n_main' into dev 2024-12-16 10:49:54 -06:00
TrèsAbhi 53a49f199a New translations en-us.json (Croatian) 2024-12-16 10:49:28 -06:00
TrèsAbhi fdfde46342 New translations en-us.json (Ukrainian) 2024-12-16 10:49:26 -06:00
TrèsAbhi 1d836b2053 New translations en-us.json (Russian) 2024-12-16 10:49:25 -06:00
tresabhi 6d448dc5c4 feat: new languages 2024-12-16 10:49:18 -06:00
tresabhi 75d4d60b30 Merge branch 'main' into l10n_main 2024-12-16 10:44:05 -06:00
tresabhi e7f47fd2fd feat: handle no next price 2024-12-16 10:41:10 -06:00
TrèsAbhi 2458d2c80c New translations en-us.json (Chinese Simplified) 2024-12-15 01:07:40 -06:00
TrèsAbhi 37a72e3bb5 New translations en-us.json (Chinese Simplified) 2024-12-15 00:08:24 -06:00
TrèsAbhi 415861f6e8 New translations en-us.json (Chinese Simplified) 2024-12-14 15:26:03 -06:00
TrèsAbhi 3124afa253 New translations en-us.json (Ukrainian) 2024-12-14 15:26:02 -06:00
TrèsAbhi 8523b9f44f New translations en-us.json (Russian) 2024-12-14 15:26:01 -06:00
TrèsAbhi 71e0404890 New translations en-us.json (Croatian (disambiguation)) 2024-12-14 15:26:00 -06:00
TrèsAbhi c01fd1f4ff New translations en-us.json (Spanish) 2024-12-14 15:25:59 -06:00
51 changed files with 591 additions and 375 deletions

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ package-lock.json
dist/
dist.*
yarn-error.log
/test.*
test.*
/docs/.vitepress/dist
/docs/.vitepress/cache
servers.csv
BIN
View File
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
# BlitzKit 1.26.5
¡Ahora en 6 idiomas! This version of BlitzKit adds support for 4 new languages totalling up to 6! [Please help translate on Crowdin](https://crowdin.com/project/blitzkrieg).
## Features
- Added Croatian, Russian, Ukrainian, and Chinese
- Pre-existing languages: English, Spanish
- Added better lighting making tanks a little less yellow and a bit more realistic
- Added custom tank icons (some may be missing when the update drops; just give them an hour or so to update)
- Increased the maximum recently viewed tanks list size to 14
- Tweaked the tank name in the hero section of the Tankopedia to allow the tank to be in the center of the page
- The headers in the Performance tool are now sticky just like the Compare tool
## Fixes
- Removed unnecessary third party script that did absolutely nothing
- Localizations are now stricter in what they allow, reducing errors in the Discord bot
- Added 50 gallons of tomato soup to the bot in an attempt to keep it alive
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "blitzkit",
"private": true,
"version": "1.26.4",
"version": "1.26.5",
"description": "🎉 Tools for everything World of Tanks Blitz",
"type": "module",
"types": "./types.d.ts",
@@ -39,6 +39,7 @@
},
"license": "MIT",
"dependencies": {
"sharp": "^0.33.5",
"lodash-es": "^4.17.21"
},
"devDependencies": {
+10 -8
View File
@@ -27,7 +27,7 @@ type Result =
available_from?: Date;
available_before?: Date;
price?: Price;
next_price?: Price | null;
next_price: Price | null;
available: true;
display?: boolean;
next_price_datetime: Date;
@@ -109,16 +109,18 @@ export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
const name = `[${tank.name}](<https://blitzkit.app/tools/tankopedia/${
tank.id
}>)`;
const next = translate('bot.commands.auction.body.next', [
`<:gold:1317173197082333244> ${data.next_price!.value.toLocaleString(
interaction.locale,
)}`,
]);
const next =
data.next_price === null
? ''
: `\n-# ${translate('bot.commands.auction.body.next', [
`<:gold:1317173197082333244> ${data.next_price.value.toLocaleString(
interaction.locale,
)}`,
])}`;
const available = translate('bot.commands.auction.body.available', [
data.current_count.toLocaleString(interaction.locale),
data.initial_count.toLocaleString(interaction.locale),
]);
const nextLine = `\n-# ${next}`;
const isOut = data.current_count === 0;
const outString = isOut ? '~~' : '';
const isLow = data.current_count <= WARNING_COUNT;
@@ -127,7 +129,7 @@ export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
outString
}${name} <:gold:1317173197082333244> ${data.price!.value.toLocaleString(
interaction.locale,
)}${outString}\n-#${isLow ? ' ‼️ ' : ' '}${available}${isOut ? '' : nextLine}`;
)}${outString}\n-#${isLow ? ' ‼️ ' : ' '}${available}${isOut ? '' : next}`;
});
const header = `${title}\n${subtitle}`;
const lines = [header, ...body];
+5 -1
View File
@@ -24,7 +24,11 @@ export const inactiveCommand = new Promise<CommandRegistry>((resolve) => {
return option
.setName('threshold')
.setNameLocalizations(
localizationObject('bot.commands.inactive.options.threshold'),
localizationObject(
'bot.commands.inactive.options.threshold',
undefined,
true,
),
)
.setDescription(
translate('bot.commands.inactive.options.threshold.description'),
@@ -63,6 +63,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
.setNameLocalizations(
localizationObject(
'bot.commands.rating_leaderboard.options.limit',
undefined,
true,
),
)
.setDescription(
@@ -87,6 +89,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
.setNameLocalizations(
localizationObject(
'bot.commands.rating_leaderboard.options.season',
undefined,
true,
),
)
.setDescription(
@@ -148,6 +152,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
.setNameLocalizations(
localizationObject(
'bot.commands.rating_leaderboard.options.league',
undefined,
true,
),
)
.setDescription(
+10 -2
View File
@@ -36,7 +36,11 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
option
.setName(t`bot.commands.research.options.target_tank`)
.setNameLocalizations(
localizationObject('bot.commands.research.options.target_tank'),
localizationObject(
'bot.commands.research.options.target_tank',
undefined,
true,
),
)
.setDescription(
t`bot.commands.research.options.target_tank.description`,
@@ -53,7 +57,11 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
option
.setName(t`bot.commands.research.options.starting_tank`)
.setNameLocalizations(
localizationObject('bot.commands.research.options.starting_tank'),
localizationObject(
'bot.commands.research.options.starting_tank',
undefined,
true,
),
)
.setDescription(
t`bot.commands.research.options.starting_tank.description`,
+5 -1
View File
@@ -24,7 +24,11 @@ export const searchClansCommand = new Promise<CommandRegistry>((resolve) => {
return option
.setName(t`bot.commands.search_clans.options.limit`)
.setNameLocalizations(
localizationObject('bot.commands.search_clans.options.limit'),
localizationObject(
'bot.commands.search_clans.options.limit',
undefined,
true,
),
)
.setDescription(
translate('bot.commands.search_clans.options.limit.description', [
+5 -1
View File
@@ -29,7 +29,11 @@ export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
option
.setName(t`bot.commands.search_players.options.limit`)
.setNameLocalizations(
localizationObject('bot.commands.search_players.options.limit'),
localizationObject(
'bot.commands.search_players.options.limit',
undefined,
true,
),
)
.setDescription(
translate('bot.commands.search_players.options.limit.description', [
@@ -7,7 +7,9 @@ export function addClanChoices(option: SlashCommandStringOption) {
return option
.setName('clan')
.setNameLocalizations(localizationObject('bot.common.options.clan'))
.setNameLocalizations(
localizationObject('bot.common.options.clan', undefined, true),
)
.setDescription(translate('bot.common.options.clan.description'))
.setDescriptionLocalizations(
localizationObject('bot.common.options.clan.description'),
@@ -25,7 +25,11 @@ export function addFilterOptions<
option
.setName(translate('bot.common.options.filters.nation'))
.setNameLocalizations(
localizationObject('bot.common.options.filters.nation'),
localizationObject(
'bot.common.options.filters.nation',
undefined,
true,
),
)
.setDescription(
translate('bot.common.options.filters.nation.description'),
@@ -52,7 +56,11 @@ export function addFilterOptions<
option
.setName(translate('bot.common.options.filters.class'))
.setNameLocalizations(
localizationObject('bot.common.options.filters.class'),
localizationObject(
'bot.common.options.filters.class',
undefined,
true,
),
)
.setDescription(
translate('bot.common.options.filters.class.description'),
@@ -78,7 +86,11 @@ export function addFilterOptions<
option
.setName(translate('bot.common.options.filters.type'))
.setNameLocalizations(
localizationObject('bot.common.options.filters.type'),
localizationObject(
'bot.common.options.filters.type',
undefined,
true,
),
)
.setDescription(
translate('bot.common.options.filters.type.description'),
@@ -18,12 +18,20 @@ export function addPeriodSubCommands(
) {
const { translate } = translator(Locale.EnglishUS);
const subcommandNameLocalizations = {
today: localizationObject('bot.common.subcommands.today'),
30: localizationObject('bot.common.subcommands.30'),
60: localizationObject('bot.common.subcommands.60'),
90: localizationObject('bot.common.subcommands.90'),
career: localizationObject('bot.common.subcommands.career'),
custom: localizationObject('bot.common.subcommands.custom'),
today: localizationObject('bot.common.subcommands.today', undefined, true),
30: localizationObject('bot.common.subcommands.30', undefined, true),
60: localizationObject('bot.common.subcommands.60', undefined, true),
90: localizationObject('bot.common.subcommands.90', undefined, true),
career: localizationObject(
'bot.common.subcommands.career',
undefined,
true,
),
custom: localizationObject(
'bot.common.subcommands.custom',
undefined,
true,
),
};
const subcommandDescriptionLocalizations = {
today: localizationObject('bot.common.subcommands.today.description'),
@@ -12,7 +12,9 @@ export function addRegionChoices(option: SlashCommandStringOption) {
return option
.setName(t`bot.common.options.region`)
.setNameLocalizations(localizationObject('bot.common.options.region'))
.setNameLocalizations(
localizationObject('bot.common.options.region', undefined, true),
)
.setDescription(t`bot.common.options.region.description`)
.setDescriptionLocalizations(
localizationObject('bot.common.options.region.description'),
@@ -7,7 +7,9 @@ export function addTankChoices(option: SlashCommandStringOption) {
return option
.setName(translate('bot.common.options.tank'))
.setNameLocalizations(localizationObject('bot.common.options.tank'))
.setNameLocalizations(
localizationObject('bot.common.options.tank', undefined, true),
)
.setDescription(translate('bot.common.options.tank.description'))
.setDescriptionLocalizations(
localizationObject('bot.common.options.tank.description'),
@@ -13,7 +13,9 @@ export function addTierChoices(option: SlashCommandStringOption) {
return option
.setName(t`bot.common.options.tier`)
.setNameLocalizations(localizationObject('bot.common.options.tier'))
.setNameLocalizations(
localizationObject('bot.common.options.tier', undefined, true),
)
.setDescription(t`bot.common.options.tier.description`)
.setDescriptionLocalizations(
localizationObject('bot.common.options.tier.description'),
@@ -7,7 +7,9 @@ export function addUsernameChoices(option: SlashCommandStringOption) {
return option
.setName(t`bot.common.options.username`)
.setNameLocalizations(localizationObject('bot.common.options.username'))
.setNameLocalizations(
localizationObject('bot.common.options.username', undefined, true),
)
.setDescription(t`bot.common.options.username.description`)
.setDescriptionLocalizations(
localizationObject('bot.common.options.username.description'),
@@ -27,7 +27,9 @@ export function createLocalizedCommand(
const { translate } = translator(Locale.EnglishUS);
const slashCommand = new SlashCommandBuilder()
.setName(command)
.setNameLocalizations(localizationObject(`bot.commands.${commandPathItem}`))
.setNameLocalizations(
localizationObject(`bot.commands.${commandPathItem}`, undefined, true),
)
.setDescription(translate(`bot.commands.${commandPathItem}.description`))
.setDescriptionLocalizations(
localizationObject(`bot.commands.${commandPathItem}.description`),
@@ -38,6 +40,8 @@ export function createLocalizedCommand(
if ('subcommand' in subItem) {
const subcommandNameLocalizations = localizationObject(
`bot.commands.${commandPathItem}.subcommands.${subItem.subcommand}`,
undefined,
true,
);
const subcommandDescriptionLocalizations = localizationObject(
`bot.commands.${commandPathItem}.subcommands.${subItem.subcommand}.description`,
@@ -59,6 +63,8 @@ export function createLocalizedCommand(
} else {
const subcommandNameLocalizations = localizationObject(
`bot.commands.${commandPathItem}.groups.${subItem.group}`,
undefined,
true,
);
const subcommandDescriptionLocalizations = localizationObject(
`bot.commands.${commandPathItem}.groups.${subItem.group}.description`,
@@ -2,13 +2,29 @@ import { Locale } from 'discord.js';
import { SUPPORTED_LOCALES } from '../localization/strings/constants';
import { translator } from '../localization/translator';
export function localizationObject(path: string, literals?: string[]) {
const validNameRegex = /^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/u;
export function localizationObject(
path: string,
literals?: string[],
strict = false,
) {
return SUPPORTED_LOCALES.reduce<Partial<Record<Locale, string>>>(
(localizations, locale) => {
const { translate } = translator(locale);
const translation = translate(path, literals);
const isValid = !strict || validNameRegex.test(translation);
if (!isValid) {
console.warn(
`Invalid localization for ${locale} (${path}): ${translation}; skipping...`,
);
return localizations;
}
return {
...localizations,
[locale]: translate(path, literals),
[locale]: translation,
};
},
{},
@@ -1,3 +1,10 @@
import { Locale } from 'discord.js';
export const SUPPORTED_LOCALES: Locale[] = [Locale.EnglishUS, Locale.SpanishES];
export const SUPPORTED_LOCALES: Locale[] = [
Locale.EnglishUS,
Locale.SpanishES,
Locale.Croatian,
Locale.Russian,
Locale.Ukrainian,
Locale.ChineseCN,
];
@@ -126,9 +126,7 @@ commands.then((awaitedCommands) => {
rest.put(
Routes.applicationCommands(assertSecret(import.meta.env.DISCORD_CLIENT_ID)),
{
body,
},
{ body },
);
});
+92 -64
View File
@@ -5,74 +5,102 @@ import {
} from './core/blitzkit/nonBlockingPromises';
import { manager } from './core/discord/manager';
console.log('pre manager event listeners and spawn');
async function setupShardManager() {
console.log('Pre-manager setup starting...');
let isFirst = true;
const interval = setInterval(() => {
if (!isFirst) {
console.warn('respawning all shards because manager died');
manager.respawnAll();
}
const readyShards = new Set();
const totalShards = manager.totalShards;
isFirst = false;
}, 5000);
const allShardsReady = new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error('Shard initialization timed out after 60 seconds'));
}, 60000);
const shards = await manager
.on('shardCreate', (shard) => {
clearInterval(interval);
console.log(`🟡 Launching shard ${shard.id}`);
shard.on('ready', () => console.log(`🟢 Launched shard ${shard.id}`));
})
.spawn();
manager.on('shardCreate', (shard) => {
console.log(`🟡 Launching shard ${shard.id}`);
console.log('post manager event listeners and spawn');
shard.on('ready', () => {
console.log(`🟢 Launched shard ${shard.id}`);
readyShards.add(shard.id);
try {
let servers = 0;
let channels = 0;
let users = 0;
for (const [, shard] of shards) {
// wtf is this typing bro???
const guilds = (await shard.fetchClientValue('guilds.cache')) as any;
servers += guilds.length;
for (const guild of guilds) {
channels += guild.channels.length;
users += guild.memberCount;
}
}
const awaitedTankDefinitions = await tankDefinitions;
const tanks = Object.values(awaitedTankDefinitions.tanks).length;
const awaitedDiscoveredIdsDefinitions = await discoveredIdsDefinitions;
const usernames = awaitedDiscoveredIdsDefinitions.count;
manager.broadcastEval(
(client, { servers, users, channels, tanks, usernames }) => {
const bios = [
`Living in ${servers.toLocaleString()} servers`,
`Serving ${users.toLocaleString()} users`,
`Observing ${channels.toLocaleString()} channels`,
`Tinkering with ${tanks.toLocaleString()} tanks`,
`Memorizing ${usernames.toLocaleString()} usernames`,
];
client.user?.setPresence({
activities: [
{
type: ActivityType.Custom,
name: bios[Math.floor(Math.random() * bios.length)],
},
],
if (readyShards.size === totalShards) {
clearTimeout(timeout);
resolve(true);
}
});
},
{ context: { servers, channels, users, tanks, usernames } },
);
} catch (error) {
console.warn(
'An error occurred when setting up presence, ignoring to keep the process alive',
error,
);
shard.on('error', (error) => {
console.error(`❌ Shard ${shard.id} encountered an error:`, error);
});
shard.on('disconnect', () => {
console.warn(`⚠️ Shard ${shard.id} disconnected`);
});
});
});
try {
console.log('Spawning shards...');
const shards = await manager.spawn();
console.log('Shards spawned, waiting for ready state...');
await allShardsReady;
console.log('All shards ready, setting up presence...');
let servers = 0;
let channels = 0;
let users = 0;
for (const [, shard] of shards) {
try {
const guilds = (await shard.fetchClientValue('guilds.cache')) as any;
servers += guilds.length;
for (const guild of guilds) {
channels += guild.channels.length;
users += guild.memberCount;
}
} catch (error) {
console.error(`Failed to fetch statistics from shard:`, error);
}
}
const [awaitedTankDefinitions, awaitedDiscoveredIdsDefinitions] =
await Promise.all([tankDefinitions, discoveredIdsDefinitions]);
const tanks = Object.values(awaitedTankDefinitions.tanks).length;
const usernames = awaitedDiscoveredIdsDefinitions.count;
await manager.broadcastEval(
(client, { servers, users, channels, tanks, usernames }) => {
const bios = [
`Living in ${servers.toLocaleString()} servers`,
`Serving ${users.toLocaleString()} users`,
`Observing ${channels.toLocaleString()} channels`,
`Tinkering with ${tanks.toLocaleString()} tanks`,
`Memorizing ${usernames.toLocaleString()} usernames`,
];
client.user?.setPresence({
activities: [
{
type: ActivityType.Custom,
name: bios[Math.floor(Math.random() * bios.length)],
},
],
});
},
{ context: { servers, channels, users, tanks, usernames } },
);
console.log('Bot startup complete!');
} catch (error) {
console.error('Critical error during startup:', error);
throw error;
}
}
setupShardManager().catch((error) => {
console.error('Failed to start the bot:', error);
process.exit(1);
});
+9 -7
View File
@@ -142,7 +142,9 @@
"no_tank_stats": "# No hay estadísticas de tanque disponibles\nEste jugador no tiene estadísticas disponibles. Este podría no ser el jugador que estás buscando.",
"get_help": "Servidor de ayuda de Discord",
"uncaught_error": "# ¡Blitzkrieg sufrió un error!\nLo sentimos mucho. Siéntete libre de [unirte al servidor oficial de Discord](https://discord.gg/nDt7AjGJQH) para obtener ayuda.",
"preview": "# Este comando es una vista previa\n\nSolo puedes acceder a este comando en [el servidor oficial de Discord](https://discord.gg/nDt7AjGJQH). Generalmente este comando estará disponible pronto."
"preview": "# Este comando es una vista previa\n\nSolo puedes acceder a este comando en [el servidor oficial de Discord](https://discord.gg/nDt7AjGJQH). Generalmente este comando estará disponible pronto.",
"query_too_small": "# Your search is too short\nYour search must be at least 3 characters long.",
"query_too_long": "# Your search is too long\nYour search must be at most 100 characters long."
},
"wn8": {
"$": "WN8",
@@ -211,13 +213,13 @@
"$": "nación",
"description": "Nación"
},
"tank_class": {
"$": "clase-de-tanque",
"description": "Clase de tanque"
"class": {
"$": "class",
"description": "Class"
},
"tree_type": {
"$": "tipo-de-árbol",
"description": "Tipo de árbol"
"type": {
"$": "type",
"description": "Type"
}
},
"region": {
+74 -72
View File
@@ -1,16 +1,16 @@
{
"common": {
"wn8_percentile": {
"0": "Jako loše",
"1": "Loše",
"2": "Ispod prosečnog",
"3": "Prosečno",
"4": "Nad prosečno",
"5": "Dobro",
"6": "Jako dobro",
"7": "Super",
"8": "Legendarno",
"9": "Super Legendarno"
"0": "Very bad",
"1": "Bad",
"2": "Below average",
"3": "Average",
"4": "Above average",
"5": "Good",
"6": "Very good",
"7": "Great",
"8": "Unicum",
"9": "Super unicum"
},
"bkni_percentile": {
"0": "Super malum",
@@ -26,15 +26,15 @@
"10": "Super unicum"
},
"nations": {
"ussr": "S.S.S.R.",
"germany": "Nemačka",
"usa": "S.A.D.",
"china": "Kina",
"uk": "Vel. Brit.",
"france": "Francuska",
"ussr": "U.S.S.R.",
"germany": "Germany",
"usa": "U.S.A.",
"china": "China",
"uk": "U.K.",
"france": "France",
"japan": "Japan",
"european": "Evropska Unija",
"other": "Hibridna nacija"
"european": "European Nation",
"other": "Hybrid Nation"
},
"nations_adjectives": {
"ussr": "U.S.S.R.",
@@ -75,9 +75,9 @@
},
"regions": {
"normal": {
"com": "Severna Amerika",
"eu": "Evropa",
"asia": "Azija-Pasifik"
"com": "North America",
"eu": "Europe",
"asia": "Asia-Pacific"
},
"short": {
"com": "NA",
@@ -86,11 +86,11 @@
}
},
"leagues": {
"diamond": "Dijamant",
"platinum": "Platina",
"gold": "Zlato",
"silver": "Srebro",
"bronze": "Bronza"
"diamond": "Diamond",
"platinum": "Platinum",
"gold": "Gold",
"silver": "Silver",
"bronze": "Bronze"
},
"composite_stats": {
"normalized_damage_dealt": "Damage",
@@ -136,58 +136,60 @@
"errors": {
"clan_not_found": "# Could not find clan\nCouldn't find \"%s\". Try selecting a clan from the search result.",
"player_not_found": "# Could not find user\nI couldn't find user \"%s\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.",
"player_not_linked": "# I don't know who you are\nUse the `/link` command to get started.",
"player_not_linked": "# Use `/link` to get started\nI don't know who you are but you can tell me today!",
"tank_name_not_found": "# Tank not found\nCould not find tank by the name \"%s\".",
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s\". Try typing the name of the tank instead of a number.",
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
"get_help": "Help Discord server",
"uncaught_error": "# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon."
"uncaught_error": "# BlitzKit ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon.",
"query_too_small": "# Your search is too short\nYour search must be at least 3 characters long.",
"query_too_long": "# Your search is too long\nYour search must be at most 100 characters long."
},
"wn8": {
"$": "WN8",
"very_bad": "Jako loše",
"bad": "Loše",
"below_average": "Ispod prosečnog",
"average": "Prosečno",
"above_average": "Nad prosečno",
"good": "Dobro",
"very_good": "Jako dobro",
"great": "Super",
"unicum": "Legendarno",
"super_unicum": "Super Legendarno"
"very_bad": "Very bad",
"bad": "Bad",
"below_average": "Below average",
"average": "Average",
"above_average": "Above average",
"good": "Good",
"very_good": "Very good",
"great": "Great",
"unicum": "Unicum",
"super_unicum": "Super unicum"
},
"subcommands": {
"today": {
"$": "danas",
"description": "Danas"
"$": "today",
"description": "Today"
},
"30": {
"$": "30",
"description": "30 dana"
"description": "30 days"
},
"60": {
"$": "60",
"description": "60 dana"
"description": "60 days"
},
"90": {
"$": "90",
"description": "90 dana"
"description": "90 days"
},
"career": {
"$": "karijera",
"description": "Karijera"
"$": "career",
"description": "Career"
},
"custom": {
"$": "proizvoljno",
"description": "Proizvoljna daljina",
"$": "custom",
"description": "Custom range",
"options": {
"start": {
"$": "kreni",
"$": "start",
"description": "Start in number of days ago from today"
},
"end": {
"$": "kraj",
"$": "end",
"description": "End in number of days ago from today"
}
}
@@ -195,7 +197,7 @@
},
"options": {
"clan": {
"$": "klan",
"$": "clan",
"description": "The clan name or tag"
},
"tank": {
@@ -211,13 +213,13 @@
"$": "nation",
"description": "Nation"
},
"tank_class": {
"$": "tank-class",
"description": "Tank class"
"class": {
"$": "class",
"description": "Class"
},
"tree_type": {
"$": "tree-type",
"description": "Tree type"
"type": {
"$": "type",
"description": "Type"
}
},
"region": {
@@ -321,23 +323,23 @@
"commands": {
"$": "commands",
"description": "List of all commands and their descriptions",
"body": "# Commands\n\nBlitzkrieg offers the following commands:\n\n"
"body": "# Commands\n\nBlitzKit offers the following commands:\n\n"
},
"embeds": {
"$": "embeds",
"description": "Kako embed radi"
"description": "How embeds work"
},
"introduction": {
"$": "uvod",
"description": "O bot-u"
"$": "introduction",
"description": "About the bot"
},
"invite": {
"$": "pozovi",
"description": "Kako pozvati robota"
"$": "invite",
"description": "How to invite the bot"
},
"timezones": {
"$": "vremenske zone",
"description": "Kako \"Blitzkrieg\" koristi podatke o tvojoj vremenskoj zoni"
"$": "timezones",
"description": "How BlitzKit infers and uses your timezone"
},
"credits": {
"$": "credits",
@@ -346,19 +348,19 @@
}
},
"breakdown": {
"$": "analiza",
"$": "breakdown",
"description": "A period's breakdown by tanks played",
"body": {
"total": "Total",
"battles": "Borbe",
"battles": "Battles",
"wn8": "WN8",
"winrate": "Procenat pobede",
"damage": "Šteta",
"unknown_tank": "Ne poznat tenk %s"
"winrate": "Winrate",
"damage": "Damage",
"unknown_tank": "Unknown tank %s"
}
},
"debug": {
"$": "odklanjanje-grešaka",
"$": "debug",
"description": "Debug information about the bot",
"body": {
"title": "# Debug\n\n",
@@ -572,7 +574,7 @@
}
},
"rating": {
"$": "rating-session",
"$": "rating",
"description": "Rating player's statistics",
"subcommands": {
"today": {
@@ -142,7 +142,9 @@
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
"get_help": "Help Discord server",
"uncaught_error": "# BlitzKit ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon."
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon.",
"query_too_small": "# Your search is too short\nYour search must be at least 3 characters long.",
"query_too_long": "# Your search is too long\nYour search must be at most 100 characters long."
},
"wn8": {
"$": "WN8",
@@ -211,13 +213,13 @@
"$": "nation",
"description": "Nation"
},
"tank_class": {
"$": "tank-class",
"description": "Tank class"
"class": {
"$": "class",
"description": "Class"
},
"tree_type": {
"$": "tree-type",
"description": "Tree type"
"type": {
"$": "type",
"description": "Type"
}
},
"region": {
@@ -142,7 +142,9 @@
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
"get_help": "Help Discord server",
"uncaught_error": "# BlitzKit ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon."
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon.",
"query_too_small": "# Your search is too short\nYour search must be at least 3 characters long.",
"query_too_long": "# Your search is too long\nYour search must be at most 100 characters long."
},
"wn8": {
"$": "WN8",
@@ -211,13 +213,13 @@
"$": "nation",
"description": "Nation"
},
"tank_class": {
"$": "tank-class",
"description": "Tank class"
"class": {
"$": "class",
"description": "Class"
},
"tree_type": {
"$": "tree-type",
"description": "Tree type"
"type": {
"$": "type",
"description": "Type"
}
},
"region": {
+91 -89
View File
@@ -1,14 +1,14 @@
{
"common": {
"wn8_percentile": {
"0": "Very bad",
"1": "Bad",
"2": "Below average",
"3": "Average",
"4": "Above average",
"5": "Good",
"6": "Very good",
"7": "Great",
"0": "非常差",
"1": "差",
"2": "较差",
"3": "平均",
"4": "高于平均",
"5": "好",
"6": "非常好",
"7": "很好",
"8": "Unicum",
"9": "Super unicum"
},
@@ -16,53 +16,53 @@
"0": "Super malum",
"1": "Malum",
"2": "Very bad",
"3": "Bad",
"4": "Below average",
"5": "Average",
"6": "Above average",
"7": "Good",
"8": "Very good",
"3": "差",
"4": "较差",
"5": "平均",
"6": "高于平均",
"7": "好",
"8": "非常好",
"9": "Unicum",
"10": "Super unicum"
},
"nations": {
"ussr": "U.S.S.R.",
"germany": "Germany",
"usa": "U.S.A.",
"china": "China",
"uk": "U.K.",
"france": "France",
"japan": "Japan",
"european": "European Nation",
"other": "Hybrid Nation"
"ussr": "苏联 (S系)",
"germany": "德国 (D系)",
"usa": "美国 (M系)",
"china": "中国 (C系)",
"uk": "英国 (Y系)",
"france": "法国 (F系)",
"japan": "日本 (R系)",
"european": "欧盟 (E系)",
"other": "X系"
},
"nations_adjectives": {
"ussr": "U.S.S.R.",
"germany": "German",
"usa": "U.S.A.",
"china": "Chinese",
"uk": "U.K.",
"france": "French",
"japan": "Japanese",
"european": "European",
"other": "Hybrid"
"ussr": "苏联 (S系)",
"germany": "德国 (D系)",
"usa": "美国 (M系)",
"china": "中国 (C系)",
"uk": "英国 (Y系)",
"france": "法国 (F系)",
"japan": "日本 (R系)",
"european": "欧盟 (E系)",
"other": "X系"
},
"tank_class_short": {
"-1": "unrecognized",
"0": "Light",
"1": "Medium",
"2": "Heavy",
"3": "TD"
"-1": "无法识别",
"0": "轻型坦克",
"1": "中型坦克",
"2": "重型坦克",
"3": "坦克歼击车"
},
"tank_class_short_plural_lowercase": {
"0": "lights",
"1": "mediums",
"2": "heavies",
"3": "TDs"
"0": "轻型坦克",
"1": "中型坦克",
"2": "重型坦克",
"3": "坦克歼击车"
},
"tank_class_medium": {
"-1": "unrecognized",
"0": "Light",
"-1": "无法识别",
"0": "轻型坦克",
"1": "Medium",
"2": "Heavy",
"3": "Tank destroyer"
@@ -118,84 +118,86 @@
"cumulative_frags": "Total kills",
"cumulative_hits": "Total hits",
"cumulative_inaccuracy": "Inaccuracy",
"cumulative_kills_to_death_ratio": "Kills to death ratio",
"cumulative_losses": "Losses",
"cumulative_misses": "Total misses",
"cumulative_shots": "Total shots",
"cumulative_spotted": "Total spots",
"cumulative_survived_battles": "Survived battles",
"cumulative_win_and_survived": "Won and survived battles",
"cumulative_wins": "Wins",
"cumulative_xp": "Total XP",
"cumulative_kills_to_death_ratio": "战损比",
"cumulative_losses": "失败",
"cumulative_misses": "总射击失误数",
"cumulative_shots": "总射击数",
"cumulative_spotted": "场均发现敌人",
"cumulative_survived_battles": "幸存场次",
"cumulative_win_and_survived": "胜利和幸存场次",
"cumulative_wins": "胜利",
"cumulative_xp": "总经验",
"cumulative_wn8": "WN8",
"cumulative_battle_life_time": "Total battle time"
"cumulative_battle_life_time": "总战斗时间"
}
},
"bot": {
"common": {
"errors": {
"clan_not_found": "# Could not find clan\nCouldn't find \"%s\". Try selecting a clan from the search result.",
"player_not_found": "# Could not find user\nI couldn't find user \"%s\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.",
"player_not_linked": "# Use `/link` to get started\nI don't know who you are but you can tell me today!",
"tank_name_not_found": "# Tank not found\nCould not find tank by the name \"%s\".",
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s\". Try typing the name of the tank instead of a number.",
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
"clan_not_found": "# 找不到军团\n找不到\"%s\"。请尝试从搜索结果中选择一个军团。",
"player_not_found": "# 找不到用户\n无法找到用户 \"%s\"。 尝试从搜索结果中挑选用户,输入一个有效的用户名或使用 \"/link\" 命令。",
"player_not_linked": "# 使用 `/link` 来开始\n我不知道你是谁,但你今天可以告诉我!",
"tank_name_not_found": "# 坦克找不到\n无法找到名为 \"%s \"的坦克。",
"tank_id_not_found": "# 坦克找不到\n无法找到ID \"%s\"的坦克。 试着输入坦克的名称而不是数字。",
"no_tank_stats": "# 没有这个坦克的数据\n这个玩家没有数据。你可能找错人了。",
"get_help": "Help Discord server",
"uncaught_error": "# BlitzKit ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon."
"uncaught_error": "# BlitzKit 崩溃了!\n非常抱歉。请加入[官方Discord](https://discord.gg/nDt7AjGJQH),以方便帮助你的问题。",
"preview": "# 此命令处于预览\n\n您只能在[官方Discord服务器](https://discord.gg/nDt7AjGJQH)访问此命令。该命令将很快可用。",
"query_too_small": "# 您的搜索太短了\n您的搜索必须至少 3 个字符长。",
"query_too_long": "# 您的搜索太长了\n您的搜索必须最长为 100 个字符。"
},
"wn8": {
"$": "WN8",
"very_bad": "Very bad",
"bad": "Bad",
"below_average": "Below average",
"average": "Average",
"above_average": "Above average",
"good": "Good",
"very_good": "Very good",
"great": "Great",
"very_bad": "非常差",
"bad": "差",
"below_average": "较差",
"average": "平均",
"above_average": "高于平均",
"good": "好",
"very_good": "非常好",
"great": "很好",
"unicum": "Unicum",
"super_unicum": "Super unicum"
},
"subcommands": {
"today": {
"$": "today",
"description": "Today"
"$": "今日:",
"description": "今日:"
},
"30": {
"$": "30",
"description": "30 days"
"description": "30天"
},
"60": {
"$": "60",
"description": "60 days"
"description": "60天"
},
"90": {
"$": "90",
"description": "90 days"
"description": "90天"
},
"career": {
"$": "career",
"description": "Career"
"$": "玩家资料",
"description": "玩家资料"
},
"custom": {
"$": "custom",
"description": "Custom range",
"$": "自定义",
"description": "自定义范围",
"options": {
"start": {
"$": "start",
"description": "Start in number of days ago from today"
"$": "开始时间",
"description": "从今天开始于数天前"
},
"end": {
"$": "end",
"description": "End in number of days ago from today"
"$": "结束时间",
"description": "从今天开始于数天前"
}
}
}
},
"options": {
"clan": {
"$": "clan",
"$": "军团",
"description": "The clan name or tag"
},
"tank": {
@@ -211,13 +213,13 @@
"$": "nation",
"description": "Nation"
},
"tank_class": {
"$": "tank-class",
"description": "Tank class"
"class": {
"$": "class",
"description": "Class"
},
"tree_type": {
"$": "tree-type",
"description": "Tree type"
"type": {
"$": "type",
"description": "Type"
}
},
"region": {
-1
View File
@@ -13,7 +13,6 @@
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1",
"protobufjs": "^7.4.0",
"sharp": "^0.33.5",
"ts-proto": "^2.2.2",
"yaml": "^2.5.0"
},
+6 -1
View File
@@ -1,5 +1,10 @@
import { asset } from '@blitzkit/core';
export function tankIcon(id: number, size: 'big' | 'small' = 'big') {
export const BLITZKIT_TANK_ICON_SIZE = { width: 40 * 16, height: 30 * 16 };
export function tankIcon(
id: number,
size: 'big' | 'small' | 'blitzkit' = 'blitzkit',
) {
return asset(`icons/tanks/${size}/${id}.webp`);
}
+3 -2
View File
@@ -13,15 +13,16 @@
"build:ratingleaderboard": "bun src/buildRatingLeaderboard.ts"
},
"dependencies": {
"esbuild": "^0.19.12",
"@blitzkit/core": "workspace:*",
"@gltf-transform/core": "^4.0.10",
"@gltf-transform/extensions": "^4.0.10",
"@gltf-transform/functions": "^4.0.10",
"csv-parse": "^5.5.6",
"decompress": "^4.2.1",
"esbuild": "^0.19.12",
"fast-xml-parser": "^4.4.1",
"progress": "^2.0.3"
"progress": "^2.0.3",
"puppeteer": "^23.10.4"
},
"devDependencies": {
"@types/decompress": "^4.2.7",
@@ -0,0 +1,51 @@
import { BLITZKIT_TANK_ICON_SIZE, fetchTankDefinitions } from '@blitzkit/core';
import { exec } from 'child_process';
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('Starting website dev server...');
const child = exec('cd ../.. && bun dev:website');
const browser = await launch();
const page = await browser.newPage();
const tanks = Object.values((await fetchTankDefinitions()).tanks);
const files: FileChange[] = [];
let index = 0;
for (const { id, name } of tanks) {
await page.setViewport({
width: BLITZKIT_TANK_ICON_SIZE.width - 1,
height: BLITZKIT_TANK_ICON_SIZE.height,
});
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
waitUntil: 'networkidle0',
});
if (index === 0) {
console.log('Dev server started!');
}
const screenshot = await page.screenshot({
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)}%`,
);
files.push({ path: `icons/tanks/blitzkit/${id}.webp`, content });
}
child.kill('SIGHUP');
await browser.close();
await commitAssets('tank icons', files);
}
@@ -39,9 +39,9 @@ import { readStringDVPL } from '../core/blitz/readStringDVPL';
import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
import { commitAssets } from '../core/github/commitAssets';
import { TankParameters } from './blitzkitTankIcons';
import { DATA } from './constants';
import { Avatar } from './skillIcons';
import { TankParameters } from './tankIcons';
function parseResearchCost(raw: number | string) {
if (typeof raw === 'number') {
+3 -1
View File
@@ -9,6 +9,7 @@ const targets = argv
?.split('=')[1]
.split(',');
import { blitzkitTankIcons } from './blitzkitTankIcons';
import { boosterIcons } from './boosterIcons';
import { camouflageIcons } from './camouflageIcons';
import { consumableProvisionIcons } from './consumableProvisionIcons';
@@ -28,7 +29,6 @@ if (!targets && !allTargets) throw new Error('No target(s) specified');
const methods = [
definitions,
tankIcons,
tankModels,
tankArmors,
gameModeBanners,
@@ -41,6 +41,8 @@ const methods = [
consumableProvisionIcons,
camouflageIcons,
boosterIcons,
tankIcons,
blitzkitTankIcons,
];
for (const method of methods) {
@@ -7,9 +7,9 @@ import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
import { commitAssets } from '../core/github/commitAssets';
import { FileChange } from '../core/github/commitMultipleFiles';
import { TankParameters } from './blitzkitTankIcons';
import { DATA } from './constants';
import { VehicleDefinitionList } from './definitions';
import { TankParameters } from './tankIcons';
export async function tankModels() {
console.log('Building tank models...');
+12 -5
View File
@@ -1,25 +1,30 @@
---
import { assertSecret } from '@blitzkit/core';
const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
import.meta.env.PUBLIC_GOOGLE_TAG_MANAGER_ID,
);
---
{/* google analytics */}
<script
is:inline
async
src={`https://www.googletagmanager.com/gtag/js?id=${assertSecret(
import.meta.env.PUBLIC_GOOGLE_TAG_MANAGER_ID,
)}`}></script>
<script is:inline>
src={`https://www.googletagmanager.com/gtag/js?id=${PUBLIC_GOOGLE_TAG_MANAGER_ID}`}
></script>
<script is:inline define:vars={{ PUBLIC_GOOGLE_TAG_MANAGER_ID }}>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', assertSecret(import.meta.env.PUBLIC_GOOGLE_TAG_MANAGER_ID));
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
</script>
{/* nitro ads */}
{
/*
<script is:inline data-cfasync="false">
window.nitroAds = window.nitroAds || {
createAd: function () {
@@ -33,3 +38,5 @@ import { assertSecret } from '@blitzkit/core';
queue: [],
};
</script>
*/
}
@@ -6,11 +6,16 @@ import { Tanks } from './Tanks';
export function TankTable({ skeleton }: MaybeSkeletonComponentProps) {
return (
<Flex justify="center">
<Flex justify="center" maxWidth="100%" flexGrow="1" position="relative">
<StickyTableRoot
size={{ initial: '1', sm: '2' }}
variant="surface"
style={{ maxWidth: '100%' }}
style={{
position: 'absolute',
maxWidth: '100%',
maxHeight: '100%',
height: '100%',
}}
>
<Header />
<Tanks skeleton={skeleton} />
@@ -23,9 +23,10 @@
.tank-search-card .image {
width: 100%;
height: 4rem;
height: 6rem;
object-position: center right;
object-fit: contain;
filter: brightness(1.25) drop-shadow(-1px -1px 4px black);
}
.tank-search-card .class-icon {
@@ -1,4 +1,4 @@
import { asset, tankIcon, TankType, type TankDefinition } from '@blitzkit/core';
import { asset, TankType, type TankDefinition } from '@blitzkit/core';
import { Flex, Link, Text, type TextProps } from '@radix-ui/themes';
import { uniq } from 'lodash-es';
import { forwardRef, type ReactNode } from 'react';
@@ -34,7 +34,7 @@ export const TankCard = forwardRef<HTMLSpanElement, TankCardProps>(
<Text
ref={ref}
tabIndex={onSelect ? 0 : undefined}
size="1"
size="2"
color={
tank.type === TankType.COLLECTOR
? 'blue'
@@ -70,7 +70,7 @@ export const TankCard = forwardRef<HTMLSpanElement, TankCardProps>(
>
<img
alt={tank.name}
src={tankIcon(tank.id)}
src={asset(`icons/tanks/blitzkit/${tank.id}.webp`)}
className="image"
draggable={false}
/>
@@ -81,6 +81,7 @@ export const TankCard = forwardRef<HTMLSpanElement, TankCardProps>(
align="center"
overflow="hidden"
width="100%"
mt="1"
>
<Icon className="class-icon" />
<Text align="center" className="name">
@@ -16,7 +16,7 @@ export const SkeletonTankCard = memo(
return (
<Flex direction="column" gap="2" ref={card}>
<Skeleton height="64px" />
<Skeleton height="5rem" />
<Skeleton height="1em" />
</Flex>
);
@@ -4,7 +4,10 @@ export function TankCardWrapper(props: GridProps) {
return (
<Grid
py="4"
columns="repeat(auto-fill, minmax(100px, 1fr))"
columns={{
initial: 'repeat(auto-fill, minmax(6rem, 1fr))',
sm: 'repeat(auto-fill, minmax(8rem, 1fr))',
}}
flow="dense"
gap="2"
gapY="6"
@@ -1 +1 @@
export const MAX_RECENTLY_VIEWED = 9;
export const MAX_RECENTLY_VIEWED = 14;
@@ -39,8 +39,8 @@ type TankSearchProps = Omit<FlexProps, 'onSelect'> & {
onSelectAll?: (tanks: TankDefinition[]) => void;
};
const PREVIEW_COUNT = 25;
const DEFAULT_LOADED_CARDS = 75;
const PREVIEW_COUNT = 20;
const DEFAULT_LOADED_CARDS = 64;
const [gameDefinitions, modelDefinitions, tankDefinitions, tankNames] =
await Promise.all([
@@ -88,7 +88,11 @@ export function Controls({ naked }: ControlsProps) {
protagonistHullOrigin.y +
protagonistTurretOrigin.y +
protagonistGunOrigin.y;
const inspectModeInitialPosition = [-8, gunHeight + 4, -13] as const;
const inspectModeInitialPosition = [
-8,
gunHeight + (naked ? 10 : 4),
-13,
] as const;
const protagonistGunOriginOnlyY = new Vector3(
0,
protagonistTurretModelDefinition.gun_origin.y,
@@ -294,10 +298,10 @@ export function Controls({ naked }: ControlsProps) {
}
} else {
camera.position.set(...inspectModeInitialPosition);
orbitControls.current.target.set(0, gunHeight / 2, 0);
orbitControls.current.target.set(0, gunHeight / (naked ? 4 : 2), 0);
orbitControls.current.enablePan = true;
orbitControls.current.enableZoom = true;
camera.fov = 25;
camera.fov = naked ? 20 : 25;
}
camera.updateProjectionMatrix();
@@ -1,9 +1,10 @@
import { Environment } from '@react-three/drei';
import { times } from 'lodash-es';
import { Euler } from 'three';
import { degToRad } from 'three/src/math/MathUtils.js';
import { useModel } from '../../../../../../hooks/useModel';
import { Duel } from '../../../../../../stores/duel';
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
import { TankopediaPersistent } from '../../../../../../stores/tankopediaPersistent';
import { TankopediaDisplay } from '../../../../../../stores/tankopediaPersistent/constants';
const LIGHTS_COUNT = 5;
@@ -14,17 +15,13 @@ export function Lighting() {
const { hasPbr } = useModel(protagonist.tank.id);
const isBrighterLighting =
!hasPbr && display !== TankopediaDisplay.StaticArmor;
const showEnvironment = TankopediaPersistent.use(
(state) => state.showEnvironment,
);
const environment = TankopediaPersistent.use((state) => state.environment);
return (
<>
<Environment
preset={environment}
background={showEnvironment}
environmentIntensity={isBrighterLighting ? 3 : 1}
files="https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/1k/winter_river_1k.hdr"
environmentIntensity={isBrighterLighting ? 1.5 : 1}
environmentRotation={new Euler(0, degToRad(180), 0)}
/>
{display === TankopediaDisplay.ShootingRange && (
<>
@@ -1,3 +1,4 @@
import { BLITZKIT_TANK_ICON_SIZE } from '@blitzkit/core';
import { Canvas } from '@react-three/fiber';
import {
forwardRef,
@@ -182,8 +183,8 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
}}
style={{
userSelect: 'none',
width: naked ? 640 : '100%',
height: naked ? 480 : '100%',
width: naked ? BLITZKIT_TANK_ICON_SIZE.width : '100%',
height: naked ? BLITZKIT_TANK_ICON_SIZE.height : '100%',
outline: naked ? '1rem red solid' : undefined,
}}
>
@@ -1,4 +1,4 @@
import { tankIcon } from '@blitzkit/core';
import { asset } from '@blitzkit/core';
import { Flex, type FlexProps, Progress } from '@radix-ui/themes';
import { useProgress } from '@react-three/drei';
@@ -11,11 +11,14 @@ export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) {
return (
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
<img src={tankIcon(id)} style={{ height: '60%', filter: 'blur(4px)' }} />
<img
src={asset(`icons/tanks/blitzkit/${id}.webp`)}
style={{ height: '75%', filter: 'blur(1rem)' }}
/>
<Progress
size="3"
value={data.progress}
style={{ position: 'absolute', width: 128 }}
style={{ position: 'absolute', width: '16rem', maxWidth: '50vw' }}
/>
</Flex>
);
@@ -84,7 +84,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
height={
isFullScreen ? '100vh' : `calc(100vh - ${NAVBAR_HEIGHT}px - 8rem)`
}
maxHeight={isFullScreen ? undefined : '40rem'}
maxHeight={isFullScreen ? undefined : '60rem'}
maxWidth={isFullScreen ? undefined : '120rem'}
flexGrow="1"
width={isFullScreen ? '100vw' : undefined}
@@ -92,47 +92,44 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
top={isFullScreen ? '0' : undefined}
left={isFullScreen ? '0' : undefined}
>
<Flex justify="center">
<Flex
display={isFullScreen ? 'none' : 'flex'}
style={{ userSelect: 'none' }}
direction="column"
align={{ initial: 'center', md: 'start' }}
justify="center"
pl={{ initial: '0', md: '9' }}
pt={{ initial: '5', md: '0' }}
overflow="hidden"
flexGrow="1"
maxWidth="40rem"
>
<Flex align="center" gap="2">
<Heading
color={treeColor}
trim="end"
size={{ initial: '7', lg: '8' }}
>
<Icon width="1em" height="1em" />
</Heading>
<Heading
weight="bold"
size={{ initial: '8', lg: '9' }}
wrap="nowrap"
color={treeColor}
>
{protagonist.name}
</Heading>
</Flex>
<Text
color="gray"
size="3"
weight="light"
ml={{ initial: '0', md: '7', lg: '8' }}
<Flex
justify="center"
position={{ initial: 'relative', md: 'absolute' }}
left={{ initial: '0', md: '5', lg: '9' }}
py="4"
top={{ initial: '8', md: '50%' }}
style={{ transform: 'translateY(-50%)' }}
direction="column"
gap={{ initial: '0', lg: '2' }}
align={{ initial: 'center', md: 'start' }}
>
<Flex align="center" gap="3">
<Heading
color={treeColor}
trim="end"
size={{ initial: '7', lg: '8' }}
>
BlitzKit Tankopedia
</Text>
<Icon width="1em" height="1em" />
</Heading>
<Heading
weight="bold"
size={{ initial: '7', lg: '9' }}
wrap="nowrap"
color={treeColor}
>
{protagonist.name}
</Heading>
</Flex>
<Text
color="gray"
size={{ initial: '3', lg: '4' }}
weight="light"
ml={{ initial: '0', md: '7', lg: '8' }}
>
BlitzKit Tankopedia
</Text>
</Flex>
<Box
@@ -1,7 +1,5 @@
import { PageWrapper } from '../../../components/PageWrapper';
import { Charts } from '../../../components/Performance/Charts';
import { ModeSwitcher } from '../../../components/Performance/ModeSwitcher';
import { PerformanceInfo } from '../../../components/Performance/PerformanceInfo';
import { PlayerCountControl } from '../../../components/Performance/PlayerCountControl';
import { TankTable } from '../../../components/Performance/Table';
import { FilterControl } from '../../../components/TankSearch/components/FilterControl';
@@ -26,10 +24,10 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
const mode = TankPerformanceEphemeral.use((state) => state.mode);
return (
<PageWrapper color="jade" maxWidth="unset">
<ModeSwitcher />
<PageWrapper color="jade" maxWidth="100%">
{/* <ModeSwitcher /> */}
<PerformanceInfo skeleton={skeleton} />
{/* <PerformanceInfo skeleton={skeleton} /> */}
<FilterControl />
<PlayerCountControl />
@@ -1,11 +1,14 @@
---
import ToolOpenGraph from '../../../components/ToolOpenGraph.astro';
import { performanceTool } from '../../../constants/tools';
import ToolLayout from '../../../layouts/ToolLayout.astro';
import BaseLayout from '../../../layouts/BaseLayout.astro';
import { Page } from './_index';
---
<ToolLayout tool={performanceTool}>
<ToolOpenGraph tool={performanceTool} />
<BaseLayout noFooter>
<Page client:only="react">
<Page skeleton slot="fallback" />
</Page>
</ToolLayout>
</BaseLayout>
@@ -5,7 +5,7 @@ import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
export function Page() {
return (
<PageWrapper color="purple" maxWidth="64rem">
<PageWrapper color="purple" maxWidth="80rem">
<TankopediaPersistent.Provider>
<App.Provider>
<TankSearch />
@@ -1,7 +1,6 @@
import * as lodash from 'lodash-es';
import { create } from 'zustand';
import { persist, subscribeWithSelector } from 'zustand/middleware';
import { ENVIRONMENTS } from '../../constants/lightingEnvironments';
import { createContextualStore } from '../../core/zustand/createContextualStore';
import { SORT_NAMES } from './constants';
@@ -13,10 +12,8 @@ export interface TankopediaPersistentStore {
wireframe: boolean;
opaque: boolean;
advancedHighlighting: boolean;
environment: (typeof ENVIRONMENTS)[number];
showGrid: boolean;
greenPenetration: boolean;
showEnvironment: boolean;
showSpacedArmor: boolean;
showExternalModules: boolean;
showPrimaryArmor: boolean;
@@ -35,10 +32,8 @@ export const TankopediaPersistent = createContextualStore(() =>
wireframe: false,
opaque: false,
advancedHighlighting: false,
environment: ENVIRONMENTS[0],
showGrid: true,
greenPenetration: false,
showEnvironment: false,
showSpacedArmor: true,
showExternalModules: true,
showPrimaryArmor: true,