diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 6cffe2288..d2cfbac13 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -37,6 +37,7 @@ env: GH_TOKEN: ${{ secrets.GH_TOKEN }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }} jobs: build: diff --git a/.vscode/settings.json b/.vscode/settings.json index 19956ba29..95df9096c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,6 +15,7 @@ "arrayfy", "artefacts", "astrojs", + "astrolib", "atgm", "Autoloader", "Autoreloader", @@ -138,9 +139,11 @@ "outfile", "ownedtanks", "paks", + "partytown", "PIXELFORMAT", "playerachievements", "playerinfo", + "playform", "pngjs", "POSITIVEX", "POSITIVEY", diff --git a/docs/changelogs/1.27.4.md b/docs/changelogs/1.27.4.md new file mode 100644 index 000000000..eb1851f3f --- /dev/null +++ b/docs/changelogs/1.27.4.md @@ -0,0 +1,3 @@ +# FreakKit 1.27.4 + +It has come to our attention that tanks are very harsh objects. To even it out, we made the website a pretty pretty princess <3 diff --git a/docs/changelogs/1.27.5.md b/docs/changelogs/1.27.5.md new file mode 100644 index 000000000..ec1b77275 --- /dev/null +++ b/docs/changelogs/1.27.5.md @@ -0,0 +1,11 @@ +# BlitzKit 1.27.5 + +This update only affects the bot. + +## Changes + +- Removed `/auction` + +## Fixes + +- Fixed a bug that caused `/rating` to disappear diff --git a/docs/changelogs/1.27.6.md b/docs/changelogs/1.27.6.md new file mode 100644 index 000000000..03bc0b084 --- /dev/null +++ b/docs/changelogs/1.27.6.md @@ -0,0 +1,23 @@ +# BlitzKit 1.27.6 + +This update only affects the website. + +## Features + +- Added a promotional card for [the official Discord server](https://discord.gg/nDt7AjGJQH) to the homepage +- Added a better navbar + - The added spaces and padding helps add more room for error when clicking, especially on mobile + - The dropdown menu is now a lost smaller, disposing of the need to scroll at all +- Added shell filters to the tank search +- Reworked the filter buttons and their positions to allow for more space + +## Fixes + +- Moved most images from imgur to BlitzKit allowing for users in certain countries to load BlitzKit without getting blocked + +## Technical Features + +- Added Partytown to offload some workload off the main thread, allowing for a more responsive experience +- Reworked `robots.txt` to disallow indexing of BlitzKit variants +- Improved the SEO further for most pages +- Added a few compressor library to speed up load times diff --git a/package.json b/package.json index 2eb36069c..d59e296d9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "blitzkit", "private": true, - "version": "1.27.3", + "version": "1.27.6", "description": "🎉 Tools for everything World of Tanks Blitz", "type": "module", "types": "./types.d.ts", diff --git a/packages/bot/src/components/CommandWrapper.tsx b/packages/bot/src/components/CommandWrapper.tsx index e03c2efca..8fe8f612c 100644 --- a/packages/bot/src/components/CommandWrapper.tsx +++ b/packages/bot/src/components/CommandWrapper.tsx @@ -16,8 +16,8 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) { gap: 16, width: '100%', color: theme.colors.textHighContrast, + backgroundColor: theme.colors.appBackground1, position: 'relative', - background: theme.colors.appBackground1, }} > {children} diff --git a/packages/bot/src/core/discord/localizationObject.ts b/packages/bot/src/core/discord/localizationObject.ts index 3e60ddfe0..d3e5560f8 100644 --- a/packages/bot/src/core/discord/localizationObject.ts +++ b/packages/bot/src/core/discord/localizationObject.ts @@ -15,7 +15,8 @@ export function localizationObject( (localizations, locale) => { const { strings } = translator(locale); const translation = literalsFunc(path(strings), literals); - const isValid = !strict || validNameRegex.test(translation); + const isValid = + (!strict || validNameRegex.test(translation)) && translation.length > 0; if (!isValid) { console.warn( diff --git a/packages/bot/src/core/discord/normalizeInteractionReturnable.ts b/packages/bot/src/core/discord/normalizeInteractionReturnable.tsx similarity index 100% rename from packages/bot/src/core/discord/normalizeInteractionReturnable.ts rename to packages/bot/src/core/discord/normalizeInteractionReturnable.tsx diff --git a/packages/bot/src/events/interactionCreate/handlers/chatInputCommand.ts b/packages/bot/src/events/interactionCreate/handlers/chatInputCommand.ts index a6228f3f2..f48f91950 100644 --- a/packages/bot/src/events/interactionCreate/handlers/chatInputCommand.ts +++ b/packages/bot/src/events/interactionCreate/handlers/chatInputCommand.ts @@ -19,11 +19,11 @@ import { Writeable } from '../../../types/writable'; export async function handleChatInputCommand( interaction: ChatInputCommandInteraction, ) { + await interaction.deferReply(); + const awaitedCommands = await commands; const registry = awaitedCommands[interaction.commandName]; - await interaction.deferReply(); - try { const returnable = await registry.handler(interaction); diff --git a/packages/bot/src/events/interactionCreate/index.ts b/packages/bot/src/events/interactionCreate/index.ts index 9b9f097b3..611b41e88 100644 --- a/packages/bot/src/events/interactionCreate/index.ts +++ b/packages/bot/src/events/interactionCreate/index.ts @@ -15,7 +15,6 @@ import { SlashCommandSubcommandsOnlyBuilder, } from 'discord.js'; import { aboutCommand } from '../../commands/about'; -import { auctionCommand } from '../../commands/auction'; import { breakdownCommand } from '../../commands/breakdown'; import { debugCommand } from '../../commands/debug'; import { evolutionCommand } from '../../commands/evolution'; @@ -80,7 +79,7 @@ interface CommandRegistryExplicit extends CommandRegistryBase { export type CommandRegistry = CommandRegistryImplicit | CommandRegistryExplicit; export const COMMANDS_RAW: Promise[] = [ - auctionCommand, + // auctionCommand, permissionsCommand, debugCommand, aboutCommand, diff --git a/packages/bot/src/main.ts b/packages/bot/src/main.ts index bf447527e..c494ba6ad 100644 --- a/packages/bot/src/main.ts +++ b/packages/bot/src/main.ts @@ -45,7 +45,7 @@ const interval = setInterval(async () => { const usernames = awaitedDiscoveredIdsDefinitions.count; manager.broadcastEval( - (client, { servers, users, channels, tanks, usernames }) => { + async (client, { servers, users, channels, tanks, usernames }) => { const bios = [ `Living in ${servers.toLocaleString()} servers`, `Serving ${users.toLocaleString()} users`, @@ -62,6 +62,13 @@ const interval = setInterval(async () => { }, ], }); + + for (const guild of client.guilds.cache.values()) { + try { + const botMember = await guild.members.fetch(client.user.id); + await botMember.setNickname('BlitzKit'); + } catch {} + } }, { context: { servers, channels, users, tanks, usernames } }, ); diff --git a/packages/bot/src/stitches.config.ts b/packages/bot/src/stitches.config.ts index 07d1f0f0e..f50f1a5fa 100644 --- a/packages/bot/src/stitches.config.ts +++ b/packages/bot/src/stitches.config.ts @@ -23,7 +23,7 @@ export const theme = { spaces: createSpaces(), colors: { - ...createColors(slateDark), + ...createColors(mauveDark), ...createColors(slateDarkA, 'alpha'), ...createColors(slate, 'light'), diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 6dfbe5b1c..5244ee979 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -756,6 +756,7 @@ }, "tank_search": { + "clear_filters": "Clear", "search_bar_hint": "Search tanks...", "recent": "Recently viewed", "select_all": "Select all", @@ -824,6 +825,12 @@ }, "home": { + "discord": { + "join_short": "Join cool people!", + "join_long": "Join super duper cool people!", + "action": "Discord" + }, + "hero": { "credit": "By %s1 ❤️" }, @@ -838,6 +845,13 @@ "seo_description": "Tools for everything World of Tanks Blitz" }, + "docs": { + "patches": { + "name": "BlitzKit Changelogs", + "seo_description": "Changelogs for BlitzKit Discord bot and website" + } + }, + "tools": { "api": { "name": "API", diff --git a/packages/preforged/tools/embed/[embed]/_index.tsx b/packages/preforged/tools/embed/[embed]/_index.tsx index 74328579b..125f2a1a9 100644 --- a/packages/preforged/tools/embed/[embed]/_index.tsx +++ b/packages/preforged/tools/embed/[embed]/_index.tsx @@ -1,4 +1,3 @@ -import { imgur } from '@blitzkit/core'; import { CodeIcon, HeightIcon, @@ -63,7 +62,7 @@ function Content({ embed }: PageProps) { const embedStateStore = EmbedState.useStore(); const config = embedConfigurations[embed] as EmbedConfig; const [backgroundImage, setBackgroundImage] = useState( - imgur('SO13zur', { format: 'jpeg' }), + '/assets/images/backgrounds/embed-default.webp', ); const fileInput = useRef(); const { strings } = useLocale(); diff --git a/packages/preforged/tools/embed/[embed]/host/index.astro b/packages/preforged/tools/embed/[embed]/host/index.astro index 19dbbcbde..8bf3f08a5 100644 --- a/packages/preforged/tools/embed/[embed]/host/index.astro +++ b/packages/preforged/tools/embed/[embed]/host/index.astro @@ -1,5 +1,4 @@ --- -import { capitalize } from 'lodash-es'; import EmbedLayout from '../../../../../../layouts/EmbedLayout.astro'; import type { getStaticPaths } from '../index.astro'; import { Page } from './_index'; @@ -7,8 +6,6 @@ import { Page } from './_index'; export { getStaticPaths } from '../index.astro'; --- -BlitzKit - {capitalize(Astro.params.embed)} embed - diff --git a/packages/preforged/tools/embed/[embed]/index.astro b/packages/preforged/tools/embed/[embed]/index.astro index 58103ddf6..c161789f6 100644 --- a/packages/preforged/tools/embed/[embed]/index.astro +++ b/packages/preforged/tools/embed/[embed]/index.astro @@ -1,4 +1,5 @@ --- +import { AstroSeo } from '@astrolib/seo'; import type { GetStaticPaths } from 'astro'; import { capitalize } from 'lodash-es'; import { embedConfigurations } from '../../../../../constants/embeds'; @@ -21,10 +22,24 @@ export const getStaticPaths = (() => { .flat(); }) satisfies GetStaticPaths; +const name = capitalize(Astro.params.embed); +const title = `BlitzKit - ${name} embed`; +const description = `BlitzKit ${name} embeds for streaming World of Tanks Blitz with extreme customization`; const { locale } = Astro.params; --- -BlitzKit - {capitalize(Astro.params.embed)} embed + - - - - + + + + + + BlitzKit @@ -133,7 +94,13 @@ const strings = getStrings(locale); - + { toolsFiltered.map((tool, index) => { const unavailableOnBranch = tool.branches?.every( @@ -150,19 +117,17 @@ const strings = getStrings(locale); if (unavailableOnBranch) return null; return ( - - {index > 0 && } - - {toolStrings.name} - - + + {toolStrings.name} + ); }) } @@ -170,7 +135,7 @@ const strings = getStrings(locale); - + - + - + - - - - + + + + + + - - - { - tools.map((tool) => { + toolsFiltered.map((tool) => { const unavailableOnBranch = tool.branches?.every( (branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH), ); + + if (unavailableOnBranch) return null; + const toolStrings = strings.website.tools[ (tool.stringsId ?? tool.id) as keyof typeof strings.website.tools ]; - if (unavailableOnBranch) return null; - return ( - - - - - - {toolStrings.name} + {toolStrings.name} - - + + ); }) } - - + + + + diff --git a/packages/website/src/components/PageWrapper.tsx b/packages/website/src/components/PageWrapper.tsx index ac2cbd0c1..f78b1dd8b 100644 --- a/packages/website/src/components/PageWrapper.tsx +++ b/packages/website/src/components/PageWrapper.tsx @@ -39,7 +39,7 @@ export function PageWrapper({ gap="4" p={padding} width="100%" - maxWidth="50rem" + maxWidth="80rem" style={{ margin: 'auto', boxSizing: 'border-box', diff --git a/packages/website/src/components/Party3.astro b/packages/website/src/components/Party3.astro index e1c275e78..415e5b90d 100644 --- a/packages/website/src/components/Party3.astro +++ b/packages/website/src/components/Party3.astro @@ -10,9 +10,14 @@ const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret( -