mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: some linting
This commit is contained in:
1 parent
ae0e2f45dc
commit
66f33746cb
30 files changed
+82
-1856
No files matched your search
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
"start:website": "bun --filter=@blitzkit/website run start",
|
"start:website": "bun --filter=@blitzkit/website run start",
|
||||||
"host:docs": "vitepress preview docs",
|
"host:docs": "vitepress preview docs",
|
||||||
"lint": "tsc",
|
"lint": "tsc",
|
||||||
"lint:website": "next lint",
|
"lint:website": "bun --filter=@blitzkit/website run lint",
|
||||||
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||||
"update": "yarn upgrade --latest",
|
"update": "yarn upgrade --latest",
|
||||||
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||||
|
|||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
|
|
||||||
|
|
||||||
const withVanillaExtract = createVanillaExtractPlugin({ tests: /\.css$/ });
|
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
|
||||||
const nextConfig = {
|
|
||||||
output: 'export',
|
|
||||||
|
|
||||||
...withVanillaExtract({
|
|
||||||
webpack: (config) => {
|
|
||||||
config.module.rules.push(
|
|
||||||
{
|
|
||||||
test: /\.glsl$/,
|
|
||||||
type: 'asset/source',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.proto$/,
|
|
||||||
type: 'asset/source',
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
distDir: 'dist/website',
|
|
||||||
reactStrictMode: true,
|
|
||||||
|
|
||||||
experimental: {
|
|
||||||
workerThreads: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default nextConfig;
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@blitzkit/website-legacy",
|
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@radix-ui/themes": "^3.1.3",
|
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
|
||||||
"@blitzkit/core": "workspace:*",
|
|
||||||
"fuzzysort": "^2.0.4",
|
|
||||||
"@nivo/bar": "^0.87.0",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"next": "^14.2.7",
|
|
||||||
"three-stdlib": "^2.32.2",
|
|
||||||
"urlon": "^3.1.0",
|
|
||||||
"react": "^18.3.1",
|
|
||||||
"@vanilla-extract/css": "^1.15.5",
|
|
||||||
"react-device-detect": "^2.2.3",
|
|
||||||
"react-dom": "^18.3.1",
|
|
||||||
"react-fuzzysort": "^1.0.1",
|
|
||||||
"immer": "^10.1.1",
|
|
||||||
"@vanilla-extract/dynamic": "^2.1.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/lodash": "^4.17.7",
|
|
||||||
"@vanilla-extract/next-plugin": "^2.4.5"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
["1.10.0","1.10.1","1.10.2","1.11.0","1.12.0","1.12.1","1.12.2","1.12.3","1.12.4","1.12.5","1.12.6","1.12.7","1.12.8","1.12.9","1.13.0","1.13.1","1.13.2","1.13.3","1.14.0","1.14.1","1.14.2","1.14.3","1.14.4","1.15.0","1.15.1","1.15.10","1.15.11","1.15.12","1.15.13","1.15.2","1.15.3","1.15.4","1.15.5","1.15.6","1.15.7","1.15.8","1.15.9","1.16.0","1.16.1","1.16.2","1.16.3","1.16.4","1.17.0","1.17.1","1.17.2","1.18.0","1.18.1","1.18.2","1.18.3","1.19.0","1.19.1","1.19.2","1.19.3","1.19.4","1.19.5","1.19.6","1.20.0","1.20.1","1.20.2","1.20.3","1.20.4","1.20.5","1.21.0","1.21.1","1.21.2","1.21.3","1.22.0","1.22.1","1.22.2","1.22.3","1.22.4","1.22.5","1.22.6","1.3.0","1.3.1","1.3.2","1.3.3","1.4.0","1.4.1","1.5.0","1.5.1","1.5.2","1.5.3","1.5.4","1.6.0","1.7.0","1.7.1","1.7.2","1.7.3-1.7.4","1.7.5","1.7.6","1.7.7","1.8.0","1.8.1","1.9.0","1.9.1","1.9.2","1.9.3","1.9.4","1.9.5"]
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 692 B |
@@ -1 +0,0 @@
|
|||||||
export const PROVIDERS = ['wargaming', 'patreon'];
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import { PROVIDERS } from './constants';
|
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
|
||||||
return PROVIDERS.map((provider) => ({ provider }));
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
import { useEffect } from 'react';
|
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
|
||||||
import * as App from '../../../stores/app';
|
|
||||||
|
|
||||||
export interface PatreonAuthResponse {
|
|
||||||
access_token: string;
|
|
||||||
expires_in: number;
|
|
||||||
token_type: 'Bearer';
|
|
||||||
scope: string;
|
|
||||||
refresh_token: string;
|
|
||||||
version: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Page({
|
|
||||||
params,
|
|
||||||
searchParams,
|
|
||||||
}: {
|
|
||||||
params: { provider: string };
|
|
||||||
searchParams: { [key: string]: string };
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
const mutateApp = App.useMutation();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
switch (params.provider) {
|
|
||||||
case 'wargaming': {
|
|
||||||
if (
|
|
||||||
!searchParams.expires_at ||
|
|
||||||
!searchParams.access_token ||
|
|
||||||
!searchParams.account_id
|
|
||||||
) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutateApp((draft) => {
|
|
||||||
draft.logins.wargaming = {
|
|
||||||
id: Number(searchParams.account_id),
|
|
||||||
token: searchParams.access_token,
|
|
||||||
expires: Number(searchParams.expires_at) * 1000,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'patreon': {
|
|
||||||
if (!searchParams.code) break;
|
|
||||||
|
|
||||||
// cannot await here because async breaks router.push :(
|
|
||||||
fetch(`/api/patreon/auth/${searchParams.code}`)
|
|
||||||
.then((response) => response.json() as Promise<PatreonAuthResponse>)
|
|
||||||
.then((data) => {
|
|
||||||
mutateApp((draft) => {
|
|
||||||
draft.logins.patreon = {
|
|
||||||
token: data.access_token,
|
|
||||||
refreshToken: data.refresh_token,
|
|
||||||
expires: Date.now() + data.expires_in * 1000,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
console.error(`Unknown provider: ${params.provider}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
router.push(searchParams.return ?? '/');
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageWrapper>
|
|
||||||
<Flex
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
align="center"
|
|
||||||
justify="center"
|
|
||||||
direction="column"
|
|
||||||
gap="2"
|
|
||||||
>
|
|
||||||
<Heading>Verifying you...</Heading>
|
|
||||||
<Text color="gray">You'll be on your way shortly.</Text>
|
|
||||||
</Flex>
|
|
||||||
</PageWrapper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
import { assertSecret, idToRegion } from '@blitzkit/core';
|
|
||||||
import { Button, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
|
||||||
import { usePathname } from 'next/navigation';
|
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
import * as App from '../../stores/app';
|
|
||||||
import { CURRENT_POLICIES_AGREEMENT_INDEX } from '../../stores/app/constants';
|
|
||||||
import { PatreonAuthResponse } from '../auth/[provider]/page';
|
|
||||||
|
|
||||||
type Extension =
|
|
||||||
| {
|
|
||||||
status: 'ok';
|
|
||||||
data: {
|
|
||||||
access_token: string;
|
|
||||||
account_id: number;
|
|
||||||
expires_at: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
status: 'error';
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wargaming: 14 (refresh: 7)
|
|
||||||
* Patreon: 31 (refresh: 15)
|
|
||||||
*/
|
|
||||||
export function Checks() {
|
|
||||||
const mutateApp = App.useMutation();
|
|
||||||
const logins = App.use((state) => state.logins);
|
|
||||||
const appStore = App.useStore();
|
|
||||||
const policiesAgreementIndex = App.use(
|
|
||||||
(state) => state.policiesAgreementIndex,
|
|
||||||
);
|
|
||||||
const pathname = usePathname();
|
|
||||||
const isLegal = pathname.startsWith('/legal');
|
|
||||||
const [showPoliciesAgreement, setShowPoliciesAgreement] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function unsubscribe() {
|
|
||||||
window.removeEventListener('scroll', show);
|
|
||||||
window.removeEventListener('pointermove', show);
|
|
||||||
window.removeEventListener('pointerdown', show);
|
|
||||||
}
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
setShowPoliciesAgreement(true);
|
|
||||||
unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
policiesAgreementIndex !== CURRENT_POLICIES_AGREEMENT_INDEX &&
|
|
||||||
!isLegal
|
|
||||||
) {
|
|
||||||
window.addEventListener('scroll', show);
|
|
||||||
window.addEventListener('pointermove', show);
|
|
||||||
window.addEventListener('pointerdown', show);
|
|
||||||
}
|
|
||||||
|
|
||||||
return unsubscribe;
|
|
||||||
}, [policiesAgreementIndex, isLegal]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (logins.wargaming) {
|
|
||||||
const expiresIn = logins.wargaming.expires - Date.now();
|
|
||||||
const expiresInDays = expiresIn / 1000 / 60 / 60 / 24;
|
|
||||||
|
|
||||||
if (expiresInDays < 0) {
|
|
||||||
mutateApp((draft) => {
|
|
||||||
draft.logins.wargaming = undefined;
|
|
||||||
});
|
|
||||||
} else if (expiresInDays < 7) {
|
|
||||||
const { wargaming } = appStore.getState().logins;
|
|
||||||
|
|
||||||
if (!wargaming) return;
|
|
||||||
|
|
||||||
fetch(
|
|
||||||
`https://api.worldoftanks.${idToRegion(
|
|
||||||
wargaming.id,
|
|
||||||
)}/wot/auth/prolongate/?application_id=${assertSecret(
|
|
||||||
process.env.PUBLIC_WARGAMING_APPLICATION_ID,
|
|
||||||
)}&access_token=${wargaming.token}`,
|
|
||||||
)
|
|
||||||
.then((response) => response.json() as Promise<Extension>)
|
|
||||||
.then((json) => {
|
|
||||||
mutateApp((draft) => {
|
|
||||||
if (json.status === 'error') {
|
|
||||||
draft.logins.wargaming = undefined;
|
|
||||||
} else {
|
|
||||||
draft.logins.wargaming = {
|
|
||||||
id: wargaming.id,
|
|
||||||
token: json.data.access_token,
|
|
||||||
expires: json.data.expires_at * 1000,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logins.patreon) {
|
|
||||||
const expiresIn = logins.patreon.expires - Date.now();
|
|
||||||
const expiresInDays = expiresIn / 1000 / 60 / 60 / 24;
|
|
||||||
|
|
||||||
if (expiresInDays < 0) {
|
|
||||||
mutateApp((draft) => {
|
|
||||||
draft.logins.patreon = undefined;
|
|
||||||
});
|
|
||||||
} else if (expiresInDays < 15) {
|
|
||||||
const { patreon } = appStore.getState().logins;
|
|
||||||
|
|
||||||
if (!patreon) return;
|
|
||||||
|
|
||||||
fetch(`/api/patreon/refresh/${patreon.refreshToken}`)
|
|
||||||
.then((response) => response.json() as Promise<PatreonAuthResponse>)
|
|
||||||
.then((data) => {
|
|
||||||
mutateApp((draft) => {
|
|
||||||
draft.logins.patreon = {
|
|
||||||
token: data.access_token,
|
|
||||||
refreshToken: data.refresh_token,
|
|
||||||
expires: Date.now() + data.expires_in * 1000,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!showPoliciesAgreement) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex
|
|
||||||
align="end"
|
|
||||||
style={{
|
|
||||||
position: 'fixed',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
background: 'var(--color-overlay)',
|
|
||||||
zIndex: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
p="8"
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
background: 'var(--color-panel-solid)',
|
|
||||||
}}
|
|
||||||
justify="center"
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
align="start"
|
|
||||||
gap="4"
|
|
||||||
style={{
|
|
||||||
maxWidth: 640 * 2,
|
|
||||||
}}
|
|
||||||
direction="column"
|
|
||||||
>
|
|
||||||
<Flex direction="column" gap="2">
|
|
||||||
<Heading>
|
|
||||||
{policiesAgreementIndex === -1
|
|
||||||
? "BlitzKit's policies"
|
|
||||||
: "BlitzKit's policies have changed"}
|
|
||||||
</Heading>
|
|
||||||
|
|
||||||
<Text>
|
|
||||||
This website utilizes cookies to perform analytics and personalize
|
|
||||||
your experience. You can learn more through{' '}
|
|
||||||
<Link href="/docs/legal/privacy-policy">our privacy policy</Link>.
|
|
||||||
You may opt out of personalized advertizement by visiting{' '}
|
|
||||||
<Link href="https://optout.aboutads.info/">WebChoices</Link>. By
|
|
||||||
using BlitzKit, you also agree to our{' '}
|
|
||||||
<Link href="/docs/legal/terms-of-service">terms of service</Link>.
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
mt="2"
|
|
||||||
onClick={() => {
|
|
||||||
appStore.setState({
|
|
||||||
policiesAgreementIndex: CURRENT_POLICIES_AGREEMENT_INDEX,
|
|
||||||
});
|
|
||||||
setShowPoliciesAgreement(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
I agree
|
|
||||||
</Button>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import { Flex, Spinner } from '@radix-ui/themes';
|
|
||||||
|
|
||||||
export function PageLoader() {
|
|
||||||
return (
|
|
||||||
<Flex align="center" justify="center" flexGrow="1">
|
|
||||||
<Spinner />
|
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
*,
|
|
||||||
html {
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radix-themes {
|
|
||||||
--default-font-family: var(--font-inter);
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
import { Flex, Theme } from '@radix-ui/themes';
|
|
||||||
import '@radix-ui/themes/styles.css';
|
|
||||||
import { Roboto_Flex } from 'next/font/google';
|
|
||||||
import { usePathname } from 'next/navigation';
|
|
||||||
import { ReactNode, Suspense } from 'react';
|
|
||||||
import { Footer } from '../components/Footer';
|
|
||||||
import { Navbar } from '../components/Navbar';
|
|
||||||
import { Party3 } from '../components/Party3';
|
|
||||||
import * as App from '../stores/app';
|
|
||||||
import { Checks } from './components/Checks';
|
|
||||||
import { PageLoader } from './components/PageLoader';
|
|
||||||
import './layout.css';
|
|
||||||
|
|
||||||
const robotoFlex = Roboto_Flex({
|
|
||||||
subsets: ['latin'],
|
|
||||||
display: 'swap',
|
|
||||||
variable: '--font-roboto-flex',
|
|
||||||
});
|
|
||||||
|
|
||||||
export default function Layout({ children }: { children: ReactNode }) {
|
|
||||||
const pathname = usePathname();
|
|
||||||
const hideNav = false;
|
|
||||||
const isRoot = pathname === '/';
|
|
||||||
|
|
||||||
return (
|
|
||||||
<App.Provider>
|
|
||||||
<html lang="en" className={robotoFlex.className}>
|
|
||||||
<head>
|
|
||||||
{isRoot && (
|
|
||||||
<>
|
|
||||||
<title>BlitzKit</title>
|
|
||||||
<meta
|
|
||||||
name="description"
|
|
||||||
content="🎉 Tools for everything World of Tanks Blitz"
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<meta property="og:site_name" content="BlitzKit" />
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.png" />
|
|
||||||
|
|
||||||
<Party3 />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body
|
|
||||||
style={{
|
|
||||||
margin: 0,
|
|
||||||
backgroundColor: hideNav ? 'transparent' : undefined,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Theme
|
|
||||||
appearance="dark"
|
|
||||||
panelBackground="solid"
|
|
||||||
radius="full"
|
|
||||||
accentColor="amber"
|
|
||||||
suppressHydrationWarning
|
|
||||||
suppressContentEditableWarning
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
direction="column"
|
|
||||||
style={{
|
|
||||||
minHeight: '100vh',
|
|
||||||
// paddingTop: isEmbed ? undefined : NAVBAR_HEIGHT,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{!hideNav && <Navbar />}
|
|
||||||
|
|
||||||
<Checks />
|
|
||||||
|
|
||||||
<Suspense fallback={<PageLoader />}>{children}</Suspense>
|
|
||||||
|
|
||||||
{!hideNav && <Footer />}
|
|
||||||
</Flex>
|
|
||||||
</Theme>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</App.Provider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { DiscordLogoIcon, HomeIcon } from '@radix-ui/react-icons';
|
|
||||||
import { Button, Flex, Heading, Text } from '@radix-ui/themes';
|
|
||||||
import { redirect, usePathname } from 'next/navigation';
|
|
||||||
import { PageWrapper } from '../components/PageWrapper';
|
|
||||||
|
|
||||||
const redirects = new Map([
|
|
||||||
['/tools/ratings', '/tools/rating'],
|
|
||||||
['/tools/tank-performance', '/tools/performance'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
const pathname = usePathname();
|
|
||||||
|
|
||||||
redirects.forEach((to, from) => {
|
|
||||||
if (pathname.startsWith(from)) {
|
|
||||||
redirect(to);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageWrapper>
|
|
||||||
<Flex direction="column" justify="center" align="center" flexGrow="1">
|
|
||||||
<Heading>404: page not found</Heading>
|
|
||||||
<Text color="gray">Where would you like to go?</Text>
|
|
||||||
|
|
||||||
<Flex mt="4" gap="2">
|
|
||||||
<Link href="/">
|
|
||||||
<Button>
|
|
||||||
<HomeIcon /> Home
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
<Link href="https://discord.gg/nDt7AjGJQH">
|
|
||||||
<Button variant="outline">
|
|
||||||
<DiscordLogoIcon /> Discord
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</PageWrapper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
import { Flex, Heading } from '@radix-ui/themes';
|
|
||||||
import { Hero } from '../../../website/src/components/Hero';
|
|
||||||
import { Plugs } from '../../../website/src/components/Plugs';
|
|
||||||
import { ToolCard } from '../../../website/src/components/ToolCard';
|
|
||||||
import {
|
|
||||||
compareTool,
|
|
||||||
discordTool,
|
|
||||||
moreTool,
|
|
||||||
ratingTool,
|
|
||||||
sessionTool,
|
|
||||||
tankopediaTool,
|
|
||||||
tankPerformanceTool,
|
|
||||||
} from '../../../website/src/constants/tools';
|
|
||||||
import { AdMidSectionResponsive } from '../components/AdMidSectionResponsive';
|
|
||||||
import { useAdExempt } from '../hooks/useAdExempt';
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
const exempt = useAdExempt();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero />
|
|
||||||
|
|
||||||
<Plugs />
|
|
||||||
|
|
||||||
<Flex p="4" justify="center" gap="4">
|
|
||||||
<Flex maxWidth="1024px" flexGrow="1" gap="4" direction="column">
|
|
||||||
<ToolCard tool={tankopediaTool} />
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
|
||||||
{/* <ToolCard tool={playerStatsTool} /> */}
|
|
||||||
<ToolCard tool={compareTool} />
|
|
||||||
<ToolCard tool={tankPerformanceTool} />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{!exempt && (
|
|
||||||
<Flex justify="center">
|
|
||||||
<AdMidSectionResponsive />
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
|
||||||
<ToolCard tool={sessionTool} />
|
|
||||||
{/* <ToolCard tool={embedTool} /> */}
|
|
||||||
<ToolCard tool={ratingTool} />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{!exempt && (
|
|
||||||
<Flex
|
|
||||||
justify="center"
|
|
||||||
display={{
|
|
||||||
initial: 'flex',
|
|
||||||
md: 'none',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<AdMidSectionResponsive />
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
|
||||||
<ToolCard tool={discordTool} />
|
|
||||||
<ToolCard tool={moreTool} />
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{!exempt && <AdMidSectionResponsive />}
|
|
||||||
|
|
||||||
<Heading>Other cool projects</Heading>
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
|
||||||
<ToolCard
|
|
||||||
tool={{
|
|
||||||
button: {
|
|
||||||
text: 'Analyze',
|
|
||||||
color: 'blue',
|
|
||||||
},
|
|
||||||
description: 'Rich historic average stats',
|
|
||||||
id: 'blitz-analysis',
|
|
||||||
image: 'j76YXGl',
|
|
||||||
title: 'BlitzAnalysis[]',
|
|
||||||
href: 'https://blitzanalysiz.com/',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ToolCard
|
|
||||||
tool={{
|
|
||||||
button: {
|
|
||||||
color: 'purple',
|
|
||||||
text: 'Install',
|
|
||||||
highContrast: true,
|
|
||||||
},
|
|
||||||
image: 'zYrrYbR',
|
|
||||||
description: 'In-game session stats',
|
|
||||||
id: 'blitz-insider',
|
|
||||||
title: 'Blitz Insider',
|
|
||||||
href: 'https://discord.gg/UjWf9eGgtR',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<div style={{ flex: 1 }} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { Flex, Heading, Switch, Text } from '@radix-ui/themes';
|
|
||||||
import { PageWrapper } from '../../components/PageWrapper';
|
|
||||||
import * as App from '../../stores/app';
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
const developerMode = App.useDeferred(false, (state) => state.developerMode);
|
|
||||||
const appStore = App.useStore();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageWrapper justify="center" align="center">
|
|
||||||
<Flex direction="column" gap="4">
|
|
||||||
<Flex gap="3" direction="column">
|
|
||||||
<Heading size="5">Advanced</Heading>
|
|
||||||
|
|
||||||
<Flex align="center" gap="2">
|
|
||||||
<Text>Developer mode</Text>
|
|
||||||
<Switch
|
|
||||||
checked={developerMode}
|
|
||||||
onCheckedChange={(checked) =>
|
|
||||||
appStore.setState({ developerMode: checked })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</PageWrapper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "next"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*",
|
|
||||||
".next/types/**/*.ts",
|
|
||||||
"../website/src/components/Performance/PerformanceInfo.tsx",
|
|
||||||
"../website/src/pages/tools/session/_index.tsx"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"buildCommand": "yarn build:website",
|
|
||||||
"outputDirectory": "dist/website",
|
|
||||||
"public": true
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
|
"lint": "astro check",
|
||||||
"build": "astro check && astro build",
|
"build": "astro check && astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import { imgur } from '@blitzkit/core';
|
import { type BoxProps } from '@radix-ui/themes';
|
||||||
import { Box, type BoxProps, Text } from '@radix-ui/themes';
|
|
||||||
import { uniqueId } from 'lodash-es';
|
|
||||||
import { useEffect, useRef } from 'react';
|
|
||||||
import type { Vector2Tuple } from 'three';
|
|
||||||
|
|
||||||
export enum AdType {
|
export enum AdType {
|
||||||
MediumRectangleHorizontalPurple = 738182777,
|
MediumRectangleHorizontalPurple = 738182777,
|
||||||
@@ -11,65 +7,65 @@ export enum AdType {
|
|||||||
HalfPageVerticalPurple = 880185176,
|
HalfPageVerticalPurple = 880185176,
|
||||||
}
|
}
|
||||||
|
|
||||||
const AD_DIMENSIONS: Record<AdType, Vector2Tuple> = {
|
// const AD_DIMENSIONS: Record<AdType, Vector2Tuple> = {
|
||||||
[AdType.MediumRectangleHorizontalPurple]: [300, 250],
|
// [AdType.MediumRectangleHorizontalPurple]: [300, 250],
|
||||||
[AdType.LeaderboardHorizontalPurple]: [728, 90],
|
// [AdType.LeaderboardHorizontalPurple]: [728, 90],
|
||||||
[AdType.WideSkyscraperVerticalPurple]: [160, 600],
|
// [AdType.WideSkyscraperVerticalPurple]: [160, 600],
|
||||||
[AdType.HalfPageVerticalPurple]: [300, 600],
|
// [AdType.HalfPageVerticalPurple]: [300, 600],
|
||||||
};
|
// };
|
||||||
|
|
||||||
type AdProps = BoxProps & {
|
type AdProps = BoxProps & {
|
||||||
type: AdType;
|
type: AdType;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Ad({ type, style, ...props }: AdProps) {
|
export function Ad({}: AdProps) {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const id = useRef(uniqueId());
|
// const id = useRef(uniqueId());
|
||||||
const dimensions = AD_DIMENSIONS[type];
|
// const dimensions = AD_DIMENSIONS[type];
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
(window as any).msAdsQueue.push(function () {
|
// (window as any).msAdsQueue.push(function () {
|
||||||
(window as any).mmnow.render({
|
// (window as any).mmnow.render({
|
||||||
adUnitId: type,
|
// adUnitId: type,
|
||||||
elementId: `${type}-${id.current}`,
|
// elementId: `${type}-${id.current}`,
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}, [type]);
|
// }, [type]);
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<Box
|
// <Box
|
||||||
position="relative"
|
// position="relative"
|
||||||
width={`${dimensions[0]}px`}
|
// width={`${dimensions[0]}px`}
|
||||||
height={`${dimensions[1]}px`}
|
// height={`${dimensions[1]}px`}
|
||||||
style={{
|
// style={{
|
||||||
outline: '1px solid var(--gray-3)',
|
// outline: '1px solid var(--gray-3)',
|
||||||
borderRadius: 'var(--radius-1)',
|
// borderRadius: 'var(--radius-1)',
|
||||||
background: `url(${imgur('DK21EHY')})`,
|
// background: `url(${imgur('DK21EHY')})`,
|
||||||
|
|
||||||
...style,
|
// ...style,
|
||||||
}}
|
// }}
|
||||||
{...props}
|
// {...props}
|
||||||
>
|
// >
|
||||||
<Text
|
// <Text
|
||||||
color="gray"
|
// color="gray"
|
||||||
style={{
|
// style={{
|
||||||
position: 'absolute',
|
// position: 'absolute',
|
||||||
top: '50%',
|
// top: '50%',
|
||||||
left: '50%',
|
// left: '50%',
|
||||||
transform: 'translate(-50%, -50%)',
|
// transform: 'translate(-50%, -50%)',
|
||||||
}}
|
// }}
|
||||||
align="center"
|
// align="center"
|
||||||
>
|
// >
|
||||||
Advertisement
|
// Advertisement
|
||||||
</Text>
|
// </Text>
|
||||||
|
|
||||||
<Box
|
// <Box
|
||||||
width={`${dimensions[0]}px`}
|
// width={`${dimensions[0]}px`}
|
||||||
height={`${dimensions[1]}px`}
|
// height={`${dimensions[1]}px`}
|
||||||
position="relative"
|
// position="relative"
|
||||||
id={`${type}-${id.current}`}
|
// id={`${type}-${id.current}`}
|
||||||
/>
|
// />
|
||||||
</Box>
|
// </Box>
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,24 @@
|
|||||||
import { Flex, type FlexProps } from '@radix-ui/themes';
|
import { type FlexProps } from '@radix-ui/themes';
|
||||||
import { Ad, AdType } from './Ad';
|
|
||||||
|
|
||||||
export function AdMidSectionResponsive(props: FlexProps) {
|
export function AdMidSectionResponsive(_: FlexProps) {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<Flex justify="center" py="4" gap="4" {...props}>
|
// <Flex justify="center" py="4" gap="4" {...props}>
|
||||||
<Ad
|
// <Ad
|
||||||
display={{
|
// display={{
|
||||||
initial: 'none',
|
// initial: 'none',
|
||||||
sm: 'block',
|
// sm: 'block',
|
||||||
}}
|
// }}
|
||||||
type={AdType.LeaderboardHorizontalPurple}
|
// type={AdType.LeaderboardHorizontalPurple}
|
||||||
/>
|
// />
|
||||||
<Ad
|
// <Ad
|
||||||
display={{
|
// display={{
|
||||||
initial: 'block',
|
// initial: 'block',
|
||||||
sm: 'none',
|
// sm: 'none',
|
||||||
}}
|
// }}
|
||||||
type={AdType.MediumRectangleHorizontalPurple}
|
// type={AdType.MediumRectangleHorizontalPurple}
|
||||||
/>
|
// />
|
||||||
</Flex>
|
// </Flex>
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GL2JVHCGPQ"
|
<script
|
||||||
></script>
|
is:inline
|
||||||
<script>
|
async
|
||||||
// @ts-nocheck
|
src="https://www.googletagmanager.com/gtag/js?id=G-GL2JVHCGPQ"></script>
|
||||||
|
<script is:inline>
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
|
||||||
function gtag() {
|
function gtag() {
|
||||||
|
|||||||
-3
@@ -32,9 +32,6 @@ export const TankModel = memo(() => {
|
|||||||
turretModelDefinition.guns[protagonist.gun.gun_type!.value.base.id];
|
turretModelDefinition.guns[protagonist.gun.gun_type!.value.base.id];
|
||||||
const { gltf } = useModel(protagonist.tank.id);
|
const { gltf } = useModel(protagonist.tank.id);
|
||||||
const nodes = Object.values(gltf.nodes);
|
const nodes = Object.values(gltf.nodes);
|
||||||
const isDynamicArmorActive = Duel.use((state) =>
|
|
||||||
state.protagonist.consumables.includes(73),
|
|
||||||
);
|
|
||||||
|
|
||||||
useTankTransform(protagonist, turretContainer, gunContainer);
|
useTankTransform(protagonist, turretContainer, gunContainer);
|
||||||
|
|
||||||
|
|||||||
-2
@@ -9,7 +9,6 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { App } from '../../../../../../stores/app';
|
|
||||||
import { Duel } from '../../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
import { $wargamingLogin } from '../../../../../../stores/wargamingLogin';
|
import { $wargamingLogin } from '../../../../../../stores/wargamingLogin';
|
||||||
import { Stars } from '../../Stars';
|
import { Stars } from '../../Stars';
|
||||||
@@ -20,7 +19,6 @@ export function VoteCaster() {
|
|||||||
const [firepower, setFirepower] = useState<StarsInt | null>(null);
|
const [firepower, setFirepower] = useState<StarsInt | null>(null);
|
||||||
const [maneuverability, setManeuverability] = useState<StarsInt | null>(null);
|
const [maneuverability, setManeuverability] = useState<StarsInt | null>(null);
|
||||||
const [survivability, setSurvivability] = useState<StarsInt | null>(null);
|
const [survivability, setSurvivability] = useState<StarsInt | null>(null);
|
||||||
const appStore = App.useStore();
|
|
||||||
// true = vote successful, false = vote failed, null = hide alert
|
// true = vote successful, false = vote failed, null = hide alert
|
||||||
const [postVote, setPostVote] = useState<boolean | null>(null);
|
const [postVote, setPostVote] = useState<boolean | null>(null);
|
||||||
// true = open, false = closed, null = casting
|
// true = open, false = closed, null = casting
|
||||||
|
|||||||
@@ -174,10 +174,6 @@ export function tankCharacteristics(
|
|||||||
[hasSupercharger, 0.35],
|
[hasSupercharger, 0.35],
|
||||||
[hasImprovedGunPowder, 0.3],
|
[hasImprovedGunPowder, 0.3],
|
||||||
);
|
);
|
||||||
const penetrationLossOverDistanceCoefficient = coefficient([
|
|
||||||
hasSupercharger,
|
|
||||||
-0.6,
|
|
||||||
]);
|
|
||||||
const aimTimeCoefficient =
|
const aimTimeCoefficient =
|
||||||
coefficient(
|
coefficient(
|
||||||
[hasEnhancedGunLayingDrive, -0.15],
|
[hasEnhancedGunLayingDrive, -0.15],
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
STAT_KEYS,
|
STAT_KEYS,
|
||||||
STAT_NAMES,
|
STAT_NAMES,
|
||||||
UNLOCALIZED_REGION_NAMES_SHORT,
|
|
||||||
deltaTankStats,
|
deltaTankStats,
|
||||||
fetchAverageDefinitions,
|
fetchAverageDefinitions,
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
@@ -17,6 +16,7 @@ import {
|
|||||||
type IndividualTankStats,
|
type IndividualTankStats,
|
||||||
type Stat,
|
type Stat,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
|
import strings from '@blitzkit/core/lang/en-US.json';
|
||||||
import {
|
import {
|
||||||
ArrowDownIcon,
|
ArrowDownIcon,
|
||||||
MagnifyingGlassIcon,
|
MagnifyingGlassIcon,
|
||||||
@@ -102,8 +102,6 @@ function Content() {
|
|||||||
: undefined,
|
: undefined,
|
||||||
[delta],
|
[delta],
|
||||||
);
|
);
|
||||||
const [showLinkOverridePrompt, setShowLinkOverridePrompt] = useState(true);
|
|
||||||
|
|
||||||
const search = debounce(async () => {
|
const search = debounce(async () => {
|
||||||
if (!input.current) return;
|
if (!input.current) return;
|
||||||
|
|
||||||
@@ -242,7 +240,7 @@ function Content() {
|
|||||||
onClick={() => track(player.account_id)}
|
onClick={() => track(player.account_id)}
|
||||||
>
|
>
|
||||||
{player.nickname} (
|
{player.nickname} (
|
||||||
{UNLOCALIZED_REGION_NAMES_SHORT[player.region]})
|
{strings.common.regions.short[player.region]})
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Session = SessionTracking | SessionNotTracking;
|
|||||||
export const Session = createContextualStore(() =>
|
export const Session = createContextualStore(() =>
|
||||||
create<Session>()(
|
create<Session>()(
|
||||||
persist(
|
persist(
|
||||||
(set) => ({
|
(_) => ({
|
||||||
columns: ['battles', 'winrate', 'wn8', 'averageDamage'],
|
columns: ['battles', 'winrate', 'wn8', 'averageDamage'],
|
||||||
tracking: false,
|
tracking: false,
|
||||||
}),
|
}),
|
||||||
|
|||||||
+1
-1
@@ -20,5 +20,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules/**/*", "dist", ".next"]
|
"exclude": ["node_modules/**/*", "dist", ".next", "packages/bot"]
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user