mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: better layouts
This commit is contained in:
1 parent
201f8f94a5
commit
97b9137e9a
15 files changed
+75
-75
No files matched your search
@@ -114,7 +114,7 @@ export const playerStatsTool: Tool = {
|
|||||||
branches: ['main', 'dev'],
|
branches: ['main', 'dev'],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tankPerformanceTool: Tool = {
|
export const performanceTool: Tool = {
|
||||||
id: 'performance',
|
id: 'performance',
|
||||||
title: 'Performance',
|
title: 'Performance',
|
||||||
description: 'Tank performance statistics',
|
description: 'Tank performance statistics',
|
||||||
@@ -153,7 +153,7 @@ export const homeTool: Tool = {
|
|||||||
export const TOOLS: Tool[] = [
|
export const TOOLS: Tool[] = [
|
||||||
tankopediaTool,
|
tankopediaTool,
|
||||||
compareTool,
|
compareTool,
|
||||||
tankPerformanceTool,
|
performanceTool,
|
||||||
sessionTool,
|
sessionTool,
|
||||||
embedTool,
|
embedTool,
|
||||||
// ratingTool,
|
// ratingTool,
|
||||||
|
|||||||
File renamed without changes.
@@ -1,55 +1,51 @@
|
|||||||
---
|
---
|
||||||
import { imgur, ImgurSize } from '@blitzkit/core';
|
import { imgur, ImgurSize } from '@blitzkit/core';
|
||||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import { TOOLS } from '../constants/tools';
|
import { type Tool } from '../constants/tools';
|
||||||
import RootLayout from './RootLayout.astro';
|
import BaseLayout from './BaseLayout.astro';
|
||||||
|
|
||||||
const { pathname } = Astro.url;
|
interface Props {
|
||||||
const pathSplit = pathname.split('/');
|
tool: Tool;
|
||||||
const toolId = pathSplit.at(2);
|
}
|
||||||
const isToolRoot = pathname === `/tools/${toolId}`;
|
|
||||||
const tool = TOOLS.find((tool) => tool.id === toolId);
|
const { tool } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
|
<title>{tool.title}</title>
|
||||||
|
<meta property="og:image" content={imgur(tool.image)} />
|
||||||
|
|
||||||
{
|
{
|
||||||
tool && isToolRoot && (
|
tool.pageDescription !== undefined && (
|
||||||
<>
|
<>
|
||||||
<title>{tool.title}</title>
|
<meta name="description" content={tool.pageDescription} />
|
||||||
<meta property="og:image" content={imgur(tool.image)} />
|
<meta property="og:description" content={tool.pageDescription} />
|
||||||
|
|
||||||
{tool.pageDescription !== undefined && (
|
|
||||||
<>
|
|
||||||
<meta name="description" content={tool.pageDescription} />
|
|
||||||
<meta property="og:description" content={tool.pageDescription} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Box
|
|
||||||
style={{
|
|
||||||
backgroundImage: `url(${imgur(tool!.image, {
|
|
||||||
format: 'jpeg',
|
|
||||||
size: ImgurSize.SmallThumbnail,
|
|
||||||
})})`,
|
|
||||||
backgroundSize: 'cover',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
direction="column"
|
|
||||||
align="center"
|
|
||||||
py="6"
|
|
||||||
style={{
|
|
||||||
backdropFilter: 'blur(4rem)',
|
|
||||||
WebkitBackdropFilter: 'blur(4rem)',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Heading size="7">{tool?.title}</Heading>
|
|
||||||
<Text>{tool?.description}</Text>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
backgroundImage: `url(${imgur(tool!.image, {
|
||||||
|
format: 'jpeg',
|
||||||
|
size: ImgurSize.SmallThumbnail,
|
||||||
|
})})`,
|
||||||
|
backgroundSize: 'cover',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
direction="column"
|
||||||
|
align="center"
|
||||||
|
py="6"
|
||||||
|
style={{
|
||||||
|
backdropFilter: 'blur(4rem)',
|
||||||
|
WebkitBackdropFilter: 'blur(4rem)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Heading size="7">{tool?.title}</Heading>
|
||||||
|
<Text>{tool?.description}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
import { DiscordLogoIcon, HomeIcon } from '@radix-ui/react-icons';
|
import { DiscordLogoIcon, HomeIcon } from '@radix-ui/react-icons';
|
||||||
import { Button, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
import { Button, Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||||
import { PageWrapper } from '../components/PageWrapper';
|
import { PageWrapper } from '../components/PageWrapper';
|
||||||
import RootLayout from '../layouts/RootLayout.astro';
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<PageWrapper>
|
<PageWrapper>
|
||||||
<Flex direction="column" justify="center" align="center" flexGrow="1">
|
<Flex direction="column" justify="center" align="center" flexGrow="1">
|
||||||
<Heading>404: page not found</Heading>
|
<Heading>404: page not found</Heading>
|
||||||
@@ -25,4 +25,4 @@ import RootLayout from '../layouts/RootLayout.astro';
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
import RootLayout from '../../../layouts/RootLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
import { AUTH_PROVIDERS, AUTH_PROVIDER_NAMES, Authorize } from './_index';
|
||||||
|
|
||||||
export const getStaticPaths = (() => {
|
export const getStaticPaths = (() => {
|
||||||
@@ -12,7 +12,7 @@ export const getStaticPaths = (() => {
|
|||||||
const { provider } = Astro.params;
|
const { provider } = Astro.params;
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<PageWrapper>
|
<PageWrapper>
|
||||||
<Flex
|
<Flex
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
@@ -29,4 +29,4 @@ const { provider } = Astro.params;
|
|||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
|
|
||||||
<Authorize client:only="react" {provider} />
|
<Authorize client:only="react" {provider} />
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
import RootLayout from '../../../../layouts/RootLayout.astro';
|
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
const ROOT = '../../../../../../../docs/';
|
const ROOT = '../../../../../../../docs/';
|
||||||
@@ -30,6 +30,6 @@ const { content } = Astro.props;
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!-- <title>{title}</title> -->
|
<!-- <title>{title}</title> -->
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<Page content={content} />
|
<Page content={content} />
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -3,7 +3,7 @@ import { MagicWandIcon, StarFilledIcon } from '@radix-ui/react-icons';
|
|||||||
import { Flex, Heading, Link } from '@radix-ui/themes';
|
import { Flex, Heading, Link } from '@radix-ui/themes';
|
||||||
import { compareVersions } from 'compare-versions';
|
import { compareVersions } from 'compare-versions';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
import RootLayout from '../../../layouts/RootLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
// this can't be used in template literal :(
|
// this can't be used in template literal :(
|
||||||
const ROOT = '../../../../../../docs/changelogs/';
|
const ROOT = '../../../../../../docs/changelogs/';
|
||||||
@@ -18,7 +18,7 @@ const versions = Object.keys(
|
|||||||
.reverse();
|
.reverse();
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<PageWrapper align="center">
|
<PageWrapper align="center">
|
||||||
<Heading mt="6" mb="4">BlitzKit patches</Heading>
|
<Heading mt="6" mb="4">BlitzKit patches</Heading>
|
||||||
|
|
||||||
@@ -45,4 +45,4 @@ const versions = Object.keys(
|
|||||||
}
|
}
|
||||||
</Flex>
|
</Flex>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -8,14 +8,14 @@ import {
|
|||||||
compareTool,
|
compareTool,
|
||||||
discordTool,
|
discordTool,
|
||||||
moreTool,
|
moreTool,
|
||||||
|
performanceTool,
|
||||||
sessionTool,
|
sessionTool,
|
||||||
tankopediaTool,
|
tankopediaTool,
|
||||||
tankPerformanceTool,
|
|
||||||
} from '../constants/tools';
|
} from '../constants/tools';
|
||||||
import RootLayout from '../layouts/RootLayout.astro';
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<HomeHero />
|
<HomeHero />
|
||||||
|
|
||||||
<Plugs />
|
<Plugs />
|
||||||
@@ -29,7 +29,7 @@ import RootLayout from '../layouts/RootLayout.astro';
|
|||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
{/* <ToolCard tool={playerStatsTool} /> */}
|
{/* <ToolCard tool={playerStatsTool} /> */}
|
||||||
<ToolCard tool={compareTool} />
|
<ToolCard tool={compareTool} />
|
||||||
<ToolCard tool={tankPerformanceTool} />
|
<ToolCard tool={performanceTool} />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
@@ -81,4 +81,4 @@ import RootLayout from '../layouts/RootLayout.astro';
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<div style={{ flex: 1 }}></div>
|
<div style={{ flex: 1 }}></div>
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
---
|
---
|
||||||
import { Flex, Heading, Link, Text } from '@radix-ui/themes';
|
import { Flex, Heading, Link, Text } from '@radix-ui/themes';
|
||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
import RootLayout from '../../../layouts/RootLayout.astro';
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
||||||
import { Options } from './_index';
|
import { Options } from './_index';
|
||||||
---
|
---
|
||||||
|
|
||||||
<title>California Consumer Privacy Act (CCPA)</title>
|
<title>California Consumer Privacy Act (CCPA)</title>
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<PageWrapper justify="center">
|
<PageWrapper justify="center">
|
||||||
<Flex direction="column">
|
<Flex direction="column">
|
||||||
<Heading mb="2">California Consumer Privacy Act (CCPA)</Heading>
|
<Heading mb="2">California Consumer Privacy Act (CCPA)</Heading>
|
||||||
@@ -22,4 +22,4 @@ import { Options } from './_index';
|
|||||||
|
|
||||||
<Options client:load />
|
<Options client:load />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
import RootLayout from '../../layouts/RootLayout.astro';
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<RootLayout>
|
<BaseLayout>
|
||||||
<Page client:load />
|
<Page client:load />
|
||||||
</RootLayout>
|
</BaseLayout>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
import { compareTool } from '../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
|
|
||||||
<ToolLayout>
|
<ToolLayout tool={compareTool}>
|
||||||
<Page client:load />
|
<Page client:load />
|
||||||
</ToolLayout>
|
</ToolLayout>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
import { Page } from './_index';
|
import { performanceTool } from '../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
|
|
||||||
<ToolLayout>
|
<ToolLayout tool={performanceTool}>
|
||||||
<Page client:load />
|
<Page client:load />
|
||||||
</ToolLayout>
|
</ToolLayout>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
import { sessionTool } from '../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
|
|
||||||
<ToolLayout>
|
<ToolLayout tool={sessionTool}>
|
||||||
<Page client:load />
|
<Page client:load />
|
||||||
</ToolLayout>
|
</ToolLayout>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
import { fetchTankDefinitions, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
||||||
import strings from '@blitzkit/core/lang/en-US.json';
|
import strings from '@blitzkit/core/lang/en-US.json';
|
||||||
import type { GetStaticPaths } from 'astro';
|
import type { GetStaticPaths } from 'astro';
|
||||||
import ToolLayout from '../../../../layouts/ToolLayout.astro';
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
@@ -29,6 +29,6 @@ const tank = tankDefinitions.tanks[id];
|
|||||||
{strings.common.tank_class_short[tank.class]}
|
{strings.common.tank_class_short[tank.class]}
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<ToolLayout>
|
<BaseLayout>
|
||||||
<Page id={id} client:load />
|
<Page id={id} client:load />
|
||||||
</ToolLayout>
|
</BaseLayout>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
import { tankopediaTool } from '../../../constants/tools';
|
||||||
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
import { Page } from './_index';
|
import { Page } from './_index';
|
||||||
---
|
---
|
||||||
|
|
||||||
<ToolLayout>
|
<ToolLayout tool={tankopediaTool}>
|
||||||
<Page client:load />
|
<Page client:load />
|
||||||
</ToolLayout>
|
</ToolLayout>
|
||||||
Reference in new issue
Block a user