feat: moved to astro

This commit is contained in:
TrèsAbhi committed 2024-09-14 18:32:36 -05:00
1 parent 292df5f5d9
commit a1721eb05e
150 files changed
+386 -363

No files matched your search

@@ -1,4 +0,0 @@
export const BRANCH_NAMES: Record<string, string> = {
dev: 'dev',
opentest: 'opentest',
};
@@ -1,69 +0,0 @@
import { imgur } from '@blitzkit/core';
import { Code, Flex, Heading, Text } from '@radix-ui/themes';
import { BRANCH_NAMES } from './constants';
export function Hero() {
const isBranchNamed =
process.env.NEXT_PUBLIC_ASSET_BRANCH &&
BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH];
return (
<Flex
align="center"
justify="center"
style={{
position: 'relative',
background: `url(${imgur('rUPie9G', { format: 'jpeg' })})`,
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
}}
px="4"
py="9"
>
<div
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
background:
'linear-gradient(var(--color-panel-translucent), var(--color-background))',
}}
/>
<Flex
direction="column"
gap="6"
align="center"
justify="center"
position="relative"
width="100%"
>
<Flex direction="column" align="center" gap="1">
<Heading size="9" weight="bold" align="center">
<Flex
align="center"
gap={{ initial: '1', xs: '4' }}
direction={{ initial: 'column', xs: 'row' }}
>
BlitzKit
{isBranchNamed && (
<Code size="8" color="gray" highContrast variant="outline">
{BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH!]}
</Code>
)}
</Flex>
</Heading>
{!isBranchNamed && (
<Text color="gray" align="center" size="4">
Everything World of Tanks Blitz
</Text>
)}
</Flex>
</Flex>
</Flex>
);
}
@@ -1,88 +0,0 @@
'use client';
import { assertSecret, patreonLoginUrl } from '@blitzkit/core';
import { ArrowRightIcon } from '@radix-ui/react-icons';
import {
Badge,
Button,
Code,
Flex,
Link,
Separator,
Text,
} from '@radix-ui/themes';
import { useLayoutEffect, useState } from 'react';
import { PatreonIcon } from '../../components/PatreonIcon';
import { useAdExempt } from '../../hooks/useAdExempt';
import * as App from '../../stores/app';
export function Plugs() {
const [hasPatreon, setHasPatreon] = useState(false);
const exempt = useAdExempt();
const patreon = App.use((state) => state.logins.patreon);
useLayoutEffect(() => {
setHasPatreon(patreon !== undefined);
}, [patreon]);
return (
<Flex
align="center"
direction="column"
justify="center"
px="4"
py="8"
gap="6"
>
{assertSecret(process.env.NEXT_PUBLIC_PROMOTE_OPENTEST) === 'true' &&
assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH) !== 'opentest' && (
<>
<Flex direction="column" gap="3" align="center">
<Flex align="center" gap="2">
<Badge color="green">NEW</Badge>
<Text size="5">
BlitzKit{' '}
<Code variant="outline" size="4" color="gray" highContrast>
opentest
</Code>{' '}
is available now{' '}
</Text>
</Flex>
<Link href="https://opentest.blitzkit.app/" target="_blank">
<Button color="green">
BlitzKit opentest <ArrowRightIcon />
</Button>
</Link>
</Flex>
<Separator size="3" />
</>
)}
<Flex direction="column" gap="3" align="center">
<Flex gap="1" align="center">
<Text size="4" align="center">
{exempt
? 'You are supporting BlitzKit, thank you!'
: 'Active Patreon supports go ad-free'}
</Text>
</Flex>
<Flex gap="2" wrap="wrap" justify="center">
<Link href="https://www.patreon.com/tresabhi" target="_blank">
<Button>
<PatreonIcon width={15} height={15} />{' '}
{exempt ? 'Manage membership' : 'Support on Patreon'}
</Button>
</Link>
{!hasPatreon && !exempt && (
<Link href={patreonLoginUrl()}>
<Button variant="outline">Log in with Patreon</Button>
</Link>
)}
</Flex>
</Flex>
</Flex>
);
}
+70 -70
View File
@@ -1,7 +1,8 @@
'use client';
import { Flex, Heading } from '@radix-ui/themes';
import { AdMidSectionResponsive } from '../components/AdMidSectionResponsive';
import { Hero } from '../../../website/src/components/Hero';
import { ToolCard } from '../../../website/src/components/ToolCard';
import {
compareTool,
discordTool,
@@ -11,96 +12,95 @@ import {
tankopediaTool,
tankPerformanceTool,
} from '../../../website/src/constants/tools';
import { AdMidSectionResponsive } from '../components/AdMidSectionResponsive';
import { useAdExempt } from '../hooks/useAdExempt';
import { Hero } from './components/Hero';
import { Plugs } from './components/Plugs';
import { ToolCard } from '../../../website/src/components/ToolCard';
import { Plugs } from '../../../website/src/components/Plugs';
export default function Page() {
const exempt = useAdExempt();
return (
<>
<Hero />
<Hero />
<Plugs />
<Plugs />
<Flex p="4" justify="center" gap="4">
<Flex maxWidth="1024px" flexGrow="1" gap="4" direction="column">
<ToolCard tool={tankopediaTool} />
<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 gap="4" direction={{ initial: 'column', sm: 'row' }}>
{/* <ToolCard tool={playerStatsTool} /> */}
<ToolCard tool={compareTool} />
<ToolCard tool={tankPerformanceTool} />
</Flex>
)}
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={sessionTool} />
{/* <ToolCard tool={embedTool} /> */}
<ToolCard tool={ratingTool} />
</Flex>
{!exempt && (
<Flex justify="center">
<AdMidSectionResponsive />
</Flex>
)}
{!exempt && (
<Flex
justify="center"
display={{
initial: 'flex',
md: 'none',
}}
>
<AdMidSectionResponsive />
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={sessionTool} />
{/* <ToolCard tool={embedTool} /> */}
<ToolCard tool={ratingTool} />
</Flex>
)}
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={discordTool} />
<ToolCard tool={moreTool} />
</Flex>
{!exempt && (
<Flex
justify="center"
display={{
initial: 'flex',
md: 'none',
}}
>
<AdMidSectionResponsive />
</Flex>
)}
{!exempt && <AdMidSectionResponsive />}
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={discordTool} />
<ToolCard tool={moreTool} />
</Flex>
<Heading>Other cool projects</Heading>
{!exempt && <AdMidSectionResponsive />}
<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',
}}
/>
<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>
</Flex>
<div style={{ flex: 1 }} />
<div style={{ flex: 1 }} />
</>
);
}
@@ -1,6 +1,6 @@
import { Box } from '@radix-ui/themes';
import { useEffect, useRef } from 'react';
import { previews } from '../../../../../../constants/embeds';
import { previews } from '../../../../../../../../website/src/constants/embeds';
import { useEmbedStateCurry } from '../../../../../../stores/embedState/utilities';
import * as styles from './index.css';
@@ -7,7 +7,7 @@ import { PageWrapper } from '../../../../../components/PageWrapper';
import {
configurations,
extractEmbedConfigDefaults,
} from '../../../../../constants/embeds';
} from '../../../../../../../website/src/constants/embeds';
import * as EmbedState from '../../../../../stores/embedState';
export interface EmbedPreviewControllerProps {
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
import {
configurations,
extractEmbedConfigDefaults,
} from '../../../../constants/embeds';
} from '../../../../../../website/src/constants/embeds';
import * as EmbedState from '../../../../stores/embedState';
export function generateStaticParams() {
@@ -16,7 +16,7 @@ import { ReactNode, useEffect, useRef, useState } from 'react';
import { stringify } from 'urlon';
import { CopyButton } from '../../../../components/CopyButton';
import { PageWrapper } from '../../../../components/PageWrapper';
import { configurations } from '../../../../constants/embeds';
import { configurations } from '../../../../../../website/src/constants/embeds';
import * as App from '../../../../stores/app';
import * as EmbedState from '../../../../stores/embedState';
import { EmbedConfig } from '../../../../stores/embedState';
@@ -5,7 +5,7 @@ import {
BreakdownEmbedCard,
BreakdownEmbedWrapper,
} from '../../../../components/TanksEmbed';
import { breakdownConfig } from '../../../../constants/embeds';
import { breakdownConfig } from '../../../../../../website/src/constants/embeds';
import { useEmbedStateCurry } from '../../../../stores/embedState/utilities';
export const compositeStatsKeysOptions = compositeStatsKeys.map((value) => ({