mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
migrate 2
This commit is contained in:
1 parent
9839d4eef5
commit
cfc0ebb8e5
18 files changed
+342
-260
No files matched your search
@@ -107,6 +107,8 @@
|
|||||||
"@astrolib/seo": "^1.0.0-beta.8",
|
"@astrolib/seo": "^1.0.0-beta.8",
|
||||||
"@blitzkit/core": "workspace:*",
|
"@blitzkit/core": "workspace:*",
|
||||||
"@blitzkit/i18n": "workspace:*",
|
"@blitzkit/i18n": "workspace:*",
|
||||||
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
||||||
|
"@fontsource-variable/roboto-flex": "^5.3.0",
|
||||||
"@fontsource/inter": "^5.2.8",
|
"@fontsource/inter": "^5.2.8",
|
||||||
"@gltf-transform/core": "^4.4.2",
|
"@gltf-transform/core": "^4.4.2",
|
||||||
"@gltf-transform/functions": "^4.4.2",
|
"@gltf-transform/functions": "^4.4.2",
|
||||||
@@ -480,6 +482,10 @@
|
|||||||
|
|
||||||
"@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw=="],
|
"@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw=="],
|
||||||
|
|
||||||
|
"@fontsource-variable/jetbrains-mono": ["@fontsource-variable/[email protected]", "", {}, "sha512-F32xpS2NsGYoQi2ADSkKTgpJj7ozajsGgDJ8woTnqjmIB+dxDIqImjl4pXZVEExu8UFZ2ndhmX18EBS/hdz3Lw=="],
|
||||||
|
|
||||||
|
"@fontsource-variable/roboto-flex": ["@fontsource-variable/[email protected]", "", {}, "sha512-bOxckUy0qXNRjhV6e4pcHGSvptix4ZRD1uaj5Za8h+p3qrb2GL4U4TQdpVmPSy0SmqwldfD+JJqEKdF68EyiAw=="],
|
||||||
|
|
||||||
"@fontsource/inter": ["@fontsource/[email protected]", "", {}, "sha512-P6r5WnJoKiNVV+zvW2xM13gNdFhAEpQ9dQJHt3naLvfg+LkF2ldgSLiF4T41lf1SQCM9QmkqPTn4TH568IRagg=="],
|
"@fontsource/inter": ["@fontsource/[email protected]", "", {}, "sha512-P6r5WnJoKiNVV+zvW2xM13gNdFhAEpQ9dQJHt3naLvfg+LkF2ldgSLiF4T41lf1SQCM9QmkqPTn4TH568IRagg=="],
|
||||||
|
|
||||||
"@gltf-transform/core": ["@gltf-transform/[email protected]", "", { "dependencies": { "property-graph": "^4.1.0" } }, "sha512-qsWKwNSwK+2s834Mt4xbYcyHqCrgNFP7hIv5s487JxebngRfDgelpghNF+kSswGb2/NuapasfK3UViFoSJJoMg=="],
|
"@gltf-transform/core": ["@gltf-transform/[email protected]", "", { "dependencies": { "property-graph": "^4.1.0" } }, "sha512-qsWKwNSwK+2s834Mt4xbYcyHqCrgNFP7hIv5s487JxebngRfDgelpghNF+kSswGb2/NuapasfK3UViFoSJJoMg=="],
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
"@astrolib/seo": "^1.0.0-beta.8",
|
"@astrolib/seo": "^1.0.0-beta.8",
|
||||||
"@blitzkit/core": "workspace:*",
|
"@blitzkit/core": "workspace:*",
|
||||||
"@blitzkit/i18n": "workspace:*",
|
"@blitzkit/i18n": "workspace:*",
|
||||||
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
||||||
|
"@fontsource-variable/roboto-flex": "^5.3.0",
|
||||||
"@fontsource/inter": "^5.2.8",
|
"@fontsource/inter": "^5.2.8",
|
||||||
"@gltf-transform/core": "^4.4.2",
|
"@gltf-transform/core": "^4.4.2",
|
||||||
"@gltf-transform/functions": "^4.4.2",
|
"@gltf-transform/functions": "^4.4.2",
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,113 @@
|
|||||||
|
---
|
||||||
|
import "@fontsource-variable/jetbrains-mono";
|
||||||
|
import "@fontsource-variable/roboto-flex";
|
||||||
|
---
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--space-0: 0.0625rem;
|
||||||
|
--space-1: 0.125rem;
|
||||||
|
--space-2: 0.25rem;
|
||||||
|
--space-3: 0.5rem;
|
||||||
|
--space-4: 1rem;
|
||||||
|
--space-5: 2rem;
|
||||||
|
--space-6: 4rem;
|
||||||
|
--space-7: 8rem;
|
||||||
|
--space-8: 16rem;
|
||||||
|
--space-9: 32rem;
|
||||||
|
|
||||||
|
--page-width: 64rem;
|
||||||
|
|
||||||
|
--max-size: max(100vw, 100vh);
|
||||||
|
--radius-max: var(--max-size);
|
||||||
|
|
||||||
|
--font-size-regular: 1rem;
|
||||||
|
--font-size-minor: 0.75rem;
|
||||||
|
--font-size-major: 1.25rem;
|
||||||
|
|
||||||
|
--font-size-heading-1: 3rem;
|
||||||
|
--font-size-heading-2: 2rem;
|
||||||
|
--font-size-heading-3: 1.5rem;
|
||||||
|
--font-size-heading-4: 1.25rem;
|
||||||
|
--font-size-heading-5: 1rem;
|
||||||
|
--font-size-heading-6: 0.75rem;
|
||||||
|
|
||||||
|
--font-family-regular: "Roboto Flex Variable", sans-serif;
|
||||||
|
--font-family-mono: "JetBrains Mono Variable", monospace;
|
||||||
|
|
||||||
|
--color-regular: var(--gray-12);
|
||||||
|
--color-low-contrast: var(--gray-11);
|
||||||
|
|
||||||
|
--weight-light: 300;
|
||||||
|
--weight-regular: 400;
|
||||||
|
--weight-medium: 500;
|
||||||
|
--weight-bold: 700;
|
||||||
|
--weight-black: 900;
|
||||||
|
|
||||||
|
--outline-interactive: var(--space-1) solid var(--gray-4);
|
||||||
|
--outline-focus: var(--space-1) solid var(--accent-6);
|
||||||
|
|
||||||
|
/* --shadow-cavity:
|
||||||
|
inset calc(var(--space-1) * sin(45deg)) calc(var(--space-1) * sin(45deg))
|
||||||
|
var(--space-1) var(--black-a3),
|
||||||
|
inset calc(var(--space-1) * sin(45deg) * -1)
|
||||||
|
calc(var(--space-1) * sin(45deg) * -1) var(--space-1) var(--white-a1); */
|
||||||
|
|
||||||
|
--shadow-bump:
|
||||||
|
inset calc(var(--space-1) * sin(45deg)) calc(var(--space-1) * sin(45deg))
|
||||||
|
var(--space-1) var(--white-a3),
|
||||||
|
inset calc(var(--space-1) * sin(45deg) * -1)
|
||||||
|
calc(var(--space-1) * sin(45deg) * -1) var(--space-1) var(--black-a3);
|
||||||
|
|
||||||
|
--shadow-outline-width: 1.5px;
|
||||||
|
--shadow-outline-width-negative: calc(var(--shadow-outline-width) * -1);
|
||||||
|
|
||||||
|
/* --shadow-interactive-background: 0 0 0 var(--shadow-outline-width)
|
||||||
|
var(--gray-6);
|
||||||
|
--shadow-interactive-shine: var(--shadow-outline-width-negative)
|
||||||
|
var(--shadow-outline-width-negative) var(--shadow-outline-width)
|
||||||
|
var(--white-a1);
|
||||||
|
--shadow-interactive-shadow: var(--shadow-outline-width)
|
||||||
|
var(--shadow-outline-width) var(--shadow-outline-width) var(--black-a4);
|
||||||
|
--shadow-interactive:
|
||||||
|
var(--shadow-interactive-shine), var(--shadow-interactive-shadow),
|
||||||
|
var(--shadow-interactive-background); */
|
||||||
|
|
||||||
|
--shadow-aggressive: var(--space-1) var(--space-1) var(--space-4)
|
||||||
|
var(--black-a11);
|
||||||
|
--shadow-subtle: 0 var(--space-1) var(--space-3) var(--black-a5);
|
||||||
|
--shadow-none: 0 0 0 transparent;
|
||||||
|
|
||||||
|
&.light {
|
||||||
|
--shadow-subtle: 0 var(--space-1) var(--space-3) var(--black-a2);
|
||||||
|
}
|
||||||
|
|
||||||
|
--blur-glass: blur(4rem);
|
||||||
|
--blur-tint: blur(8rem);
|
||||||
|
|
||||||
|
--duration-brief: 200ms;
|
||||||
|
--duration-subtle: 2s;
|
||||||
|
|
||||||
|
--tank-card-min-width: 8rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style is:global>
|
||||||
|
.composable-radius {
|
||||||
|
&[data-radius="1"] {
|
||||||
|
border-radius: var(--space-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-radius="2"] {
|
||||||
|
border-radius: var(--space-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-radius="3"] {
|
||||||
|
border-radius: var(--space-5);
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-radius="max"] {
|
||||||
|
border-radius: var(--radius-max);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
import type { Color } from "../ui/color";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
color: Color;
|
||||||
|
alias: string;
|
||||||
|
alpha?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { color, alias, alpha } = Astro.props;
|
||||||
|
|
||||||
|
let styles = "";
|
||||||
|
|
||||||
|
styles += ":root{";
|
||||||
|
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
const n = i + 1;
|
||||||
|
styles += `--${alias}-${alpha ? "a" : ""}${n}:var(--${color}-${alpha ? "a" : ""}${n});`;
|
||||||
|
}
|
||||||
|
|
||||||
|
styles += "}";
|
||||||
|
|
||||||
|
styles += `*[data-accent='${alias}']{`;
|
||||||
|
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
const n = i + 1;
|
||||||
|
styles += `--accent-${alpha ? "a" : ""}${n}:var(--${alias}-${alpha ? "a" : ""}${n});`;
|
||||||
|
}
|
||||||
|
|
||||||
|
styles += "}";
|
||||||
|
---
|
||||||
|
|
||||||
|
<style set:html={styles}></style>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
import * as colors from "@radix-ui/colors";
|
||||||
|
import type { Color } from "../ui/color";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
color: Color | AlphaOnlyColor;
|
||||||
|
alpha?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ALPHA_ONLY_COLORS = ["black", "white"] as const;
|
||||||
|
type AlphaOnlyColor = (typeof ALPHA_ONLY_COLORS)[number];
|
||||||
|
|
||||||
|
const { color, alpha } = Astro.props;
|
||||||
|
const nameLight = `${color}${alpha ? "A" : ""}`;
|
||||||
|
const nameDark = `${color}${
|
||||||
|
ALPHA_ONLY_COLORS.includes(color as AlphaOnlyColor) ? "" : "Dark"
|
||||||
|
}${alpha ? "A" : ""}`;
|
||||||
|
const scaleLight = colors[nameLight as keyof typeof colors];
|
||||||
|
const scaleDark = colors[nameDark as keyof typeof colors];
|
||||||
|
|
||||||
|
let styles = "";
|
||||||
|
|
||||||
|
styles += ":root.dark{";
|
||||||
|
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
const n = i + 1;
|
||||||
|
const value =
|
||||||
|
scaleDark[`${color}${alpha ? "A" : ""}${n}` as keyof typeof scaleDark];
|
||||||
|
styles += `--${color}-${alpha ? "a" : ""}${n}:${value};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
styles += "}";
|
||||||
|
styles += ":root.light{";
|
||||||
|
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
const n = i + 1;
|
||||||
|
const value =
|
||||||
|
scaleLight[`${color}${alpha ? "A" : ""}${n}` as keyof typeof scaleLight];
|
||||||
|
styles += `--${color}-${alpha ? "a" : ""}${n}:${value};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
styles += "}";
|
||||||
|
|
||||||
|
styles += `*[data-accent='${color}']{`;
|
||||||
|
|
||||||
|
for (let i = 0; i < 12; i++) {
|
||||||
|
const n = i + 1;
|
||||||
|
styles += `--accent-${alpha ? "a" : ""}${n}:var(--${color}-${alpha ? "a" : ""}${n});`;
|
||||||
|
}
|
||||||
|
|
||||||
|
styles += "}";
|
||||||
|
---
|
||||||
|
|
||||||
|
<style set:html={styles}></style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Heading } from "@radix-ui/themes";
|
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Heading size="8">{strings.home.cosmetics}</Heading>
|
<Heading size="5">{strings.home.cosmetics}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot minor>
|
<ToolCardLayoutRoot minor>
|
||||||
<ToolCardLayoutColumn>
|
<ToolCardLayoutColumn>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Heading } from "@radix-ui/themes";
|
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Heading size="8" className="title">{strings.home.games}</Heading>
|
<Heading size="5" className="title">{strings.home.games}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
<ToolCardLayoutColumn major>
|
<ToolCardLayoutColumn major>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Heading } from "@radix-ui/themes";
|
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Heading size="8">{strings.home.players}</Heading>
|
<Heading size="5">{strings.home.players}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
<ToolCardLayoutColumn>
|
<ToolCardLayoutColumn>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Heading } from "@radix-ui/themes";
|
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -14,7 +14,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Heading size="8">{strings.home.tanks}</Heading>
|
<Heading size="5">{strings.home.tanks}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot>
|
<ToolCardLayoutRoot>
|
||||||
<ToolCardLayoutColumn major>
|
<ToolCardLayoutColumn major>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Heading } from "@radix-ui/themes";
|
|
||||||
import { tools } from "../constants/tools";
|
import { tools } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import ToolCard from "./ToolCard.astro";
|
import ToolCard from "./ToolCard.astro";
|
||||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
|||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Heading size="8">{strings.home.technical}</Heading>
|
<Heading size="5">{strings.home.technical}</Heading>
|
||||||
|
|
||||||
<ToolCardLayoutRoot minor>
|
<ToolCardLayoutRoot minor>
|
||||||
<ToolCardLayoutColumn>
|
<ToolCardLayoutColumn>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import locales from "@blitzkit/i18n/locales.json";
|
import locales from "@blitzkit/i18n/locales.json";
|
||||||
import { Link, type LinkProps } from "@radix-ui/themes";
|
import { Link, type LinkProps } from "./Link";
|
||||||
import type { LocaleAcceptorProps } from "../hooks/useLocale";
|
|
||||||
|
|
||||||
type LinkI18nProps = LinkProps & LocaleAcceptorProps;
|
export interface LinkI18n extends LinkProps {
|
||||||
|
locale: string;
|
||||||
export function LinkI18n({ locale, href, ...props }: LinkI18nProps) {
|
}
|
||||||
const prefix =
|
|
||||||
locale === undefined || locale === locales.default ? "" : `/${locale}`;
|
|
||||||
|
|
||||||
|
export function LinkI18n({ locale, href, ...props }: LinkI18n) {
|
||||||
return (
|
return (
|
||||||
<Link href={href?.startsWith("/") ? `${prefix}${href}` : href} {...props} />
|
<Link
|
||||||
|
href={`${locale === locales.default ? "" : `/${locale}`}${href}`}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import { Flex, type FlexProps, Theme } from "@radix-ui/themes";
|
|
||||||
import type { ComponentProps } from "react";
|
|
||||||
import { NAVBAR_HEIGHT } from "../constants/navbar";
|
|
||||||
import type { RadixSize } from "../stores/embedState";
|
|
||||||
import { BlitzKitTheme } from "./BlitzKitTheme";
|
|
||||||
|
|
||||||
type PageWrapperProps = FlexProps & {
|
|
||||||
color?: ComponentProps<typeof Theme>["accentColor"];
|
|
||||||
containerProps?: ComponentProps<typeof Theme>;
|
|
||||||
noFlex1?: boolean;
|
|
||||||
padding?: RadixSize;
|
|
||||||
noMinHeight?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function PageWrapper({
|
|
||||||
style,
|
|
||||||
color,
|
|
||||||
children,
|
|
||||||
noFlex1 = false,
|
|
||||||
containerProps,
|
|
||||||
noMinHeight = false,
|
|
||||||
padding = "4",
|
|
||||||
...props
|
|
||||||
}: PageWrapperProps) {
|
|
||||||
return (
|
|
||||||
<BlitzKitTheme
|
|
||||||
accentColor={color}
|
|
||||||
style={{
|
|
||||||
flex: noFlex1 ? undefined : 1,
|
|
||||||
display: "flex",
|
|
||||||
minHeight: noMinHeight ? "unset" : `calc(100svh - ${NAVBAR_HEIGHT}px)`,
|
|
||||||
flexDirection: "column",
|
|
||||||
...containerProps?.style,
|
|
||||||
}}
|
|
||||||
{...containerProps}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
direction="column"
|
|
||||||
gap="9"
|
|
||||||
p={padding}
|
|
||||||
width="100%"
|
|
||||||
maxWidth="80rem"
|
|
||||||
style={{
|
|
||||||
margin: "auto",
|
|
||||||
boxSizing: "border-box",
|
|
||||||
flex: 1,
|
|
||||||
...style,
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Flex>
|
|
||||||
</BlitzKitTheme>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { assertSecret } from "@blitzkit/core";
|
|
||||||
import { ArrowRightIcon } from "@radix-ui/react-icons";
|
|
||||||
import { Button, Code, Flex, Link, Text } from "@radix-ui/themes";
|
|
||||||
|
|
||||||
export function Plugs() {
|
|
||||||
const promoteOpentest =
|
|
||||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === "true" &&
|
|
||||||
assertSecret(import.meta.env.PUBLIC_ENVIRONMENT) !== "opentest";
|
|
||||||
const promotions = [promoteOpentest];
|
|
||||||
|
|
||||||
if (promotions.every((promotion) => !promotion)) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex
|
|
||||||
align="center"
|
|
||||||
direction="column"
|
|
||||||
justify="center"
|
|
||||||
px="4"
|
|
||||||
py="8"
|
|
||||||
gap="6"
|
|
||||||
>
|
|
||||||
{promoteOpentest && (
|
|
||||||
<Flex direction="column" gap="3" align="center">
|
|
||||||
<Text size="5">
|
|
||||||
BlitzKit{" "}
|
|
||||||
<Code variant="outline" size="4" color="gray">
|
|
||||||
opentest
|
|
||||||
</Code>{" "}
|
|
||||||
is available now{" "}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Link href="https://opentest.blitzkit.app/" target="_blank">
|
|
||||||
<Button color="green">
|
|
||||||
BlitzKit opentest <ArrowRightIcon />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
import { Box, Flex, Heading, Text } from "@radix-ui/themes";
|
|
||||||
import type { Tool } from "../constants/tools";
|
import type { Tool } from "../constants/tools";
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
|
import { Heading } from "./Heading";
|
||||||
import { LinkI18n } from "./LinkI18n";
|
import { LinkI18n } from "./LinkI18n";
|
||||||
|
import { Text } from "./Text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
tool: Tool;
|
tool: Tool;
|
||||||
locale: string;
|
locale: string;
|
||||||
significant?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { locale, tool, significant } = Astro.props;
|
const { locale, tool } = Astro.props;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
const toolStrings =
|
const toolStrings =
|
||||||
strings.website.tools[
|
strings.website.tools[
|
||||||
@@ -20,19 +20,19 @@ const toolStrings =
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
border-radius: var(--radius-3);
|
border-radius: var(--radius-3);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
height: 16rem;
|
height: 16rem;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&[data-disabled="true"] {
|
&[data-disabled="true"] {
|
||||||
opacity: 0.25;
|
opacity: 0.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-significant="true"] {
|
|
||||||
width: 100%;
|
|
||||||
height: min(20rem, 50vh);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
@@ -41,19 +41,35 @@ const toolStrings =
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
|
.background {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
gap: var(--space-4);
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<Flex
|
<div
|
||||||
style={{
|
style={{ backgroundImage: `url(/assets/images/tools/${tool.id}.webp)` }}
|
||||||
backgroundImage: `url(/assets/images/tools/${tool.id}.webp)`,
|
class="container"
|
||||||
}}
|
|
||||||
data-significant={significant}
|
|
||||||
className="container"
|
|
||||||
position="relative"
|
|
||||||
overflow="hidden"
|
|
||||||
flexGrow={significant ? undefined : "1"}
|
|
||||||
flexBasis={significant ? undefined : { initial: undefined, sm: "0" }}
|
|
||||||
>
|
>
|
||||||
<LinkI18n
|
<LinkI18n
|
||||||
{locale}
|
{locale}
|
||||||
@@ -62,49 +78,29 @@ const toolStrings =
|
|||||||
href={tool.href ?? `/${tool.id}`}
|
href={tool.href ?? `/${tool.id}`}
|
||||||
target={tool.href ? "_blank" : undefined}
|
target={tool.href ? "_blank" : undefined}
|
||||||
>
|
>
|
||||||
<Box
|
<div
|
||||||
flexGrow="1"
|
class="background"
|
||||||
style={{
|
style={{ backgroundImage: `url(/assets/images/tools/${tool.id}.webp)` }}
|
||||||
backgroundImage: `url(/assets/images/tools/${tool.id}.webp)`,
|
>
|
||||||
backgroundSize: "cover",
|
</div>
|
||||||
backgroundPosition: "center",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Flex
|
<div
|
||||||
px={{ initial: "6", md: significant ? "8" : "6" }}
|
class="content"
|
||||||
py={{ initial: "4", sm: significant ? "6" : "4" }}
|
|
||||||
gap="4"
|
|
||||||
align="center"
|
|
||||||
justify="between"
|
|
||||||
width="100%"
|
|
||||||
direction={{ initial: "column", xs: "row" }}
|
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "var(--color-panel-translucent)",
|
backgroundColor: "var(--color-panel-translucent)",
|
||||||
backdropFilter: "blur(64px) brightness(50%)",
|
backdropFilter: "blur(64px) brightness(50%)",
|
||||||
WebkitBackdropFilter: "blur(64px)",
|
WebkitBackdropFilter: "blur(64px)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex
|
<div class="wrapper">
|
||||||
direction="column"
|
<Heading weight="medium">
|
||||||
justify="center"
|
|
||||||
align={{ initial: "center", xs: "start" }}
|
|
||||||
>
|
|
||||||
<Heading
|
|
||||||
align={{ initial: "center", sm: "left" }}
|
|
||||||
size={{ initial: "6", sm: significant ? "7" : "5" }}
|
|
||||||
weight="medium"
|
|
||||||
>
|
|
||||||
{toolStrings.name}
|
{toolStrings.name}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Text
|
|
||||||
align={{ initial: "center", sm: "left" }}
|
<Text color="gray">
|
||||||
size={{ initial: "3", sm: significant ? "4" : "3" }}
|
|
||||||
color="gray"
|
|
||||||
>
|
|
||||||
{toolStrings.description}
|
{toolStrings.description}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</div>
|
||||||
</Flex>
|
</div>
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
</Flex>
|
</div>
|
||||||
@@ -1,48 +1,81 @@
|
|||||||
---
|
---
|
||||||
import strings from "@blitzkit/i18n/strings/en.json";
|
import BaseMeta from "../components/BaseMeta.astro";
|
||||||
import { Flex } from "@radix-ui/themes";
|
import BaseStyles from "../components/BaseStyles.astro";
|
||||||
import Analytics from "../components/Analytics.astro";
|
import ColorAlias from "../components/ColorAlias.astro";
|
||||||
import { BlitzKitTheme } from "../components/BlitzKitTheme";
|
import ColorScale from "../components/ColorScale.astro";
|
||||||
import { Checks } from "../components/Checks";
|
import type { Color } from "../ui/color";
|
||||||
import EasterEggs from "../components/EasterEggs.astro";
|
|
||||||
import Footer from "../components/Footer.astro";
|
|
||||||
import LocaleRedirector from "../components/LocaleRedirector.astro";
|
|
||||||
import Meta from "../components/Meta.astro";
|
|
||||||
import Servicing from "../components/Servicing.astro";
|
|
||||||
import "./base.css";
|
|
||||||
|
|
||||||
export interface Props {
|
interface Props {
|
||||||
noFooter?: boolean;
|
|
||||||
noNavbar?: boolean;
|
|
||||||
integrated?: boolean;
|
|
||||||
locale: string;
|
locale: string;
|
||||||
|
accent: Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
const servicing = import.meta.env.SERVICING;
|
const { accent, locale } = Astro.props;
|
||||||
const { noFooter, noNavbar, integrated, locale } = Astro.props;
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang={locale}>
|
<html lang={locale} class="dark">
|
||||||
<head>
|
<head>
|
||||||
<meta property="og:site_name" content={strings.common.name} />
|
<BaseMeta />
|
||||||
|
|
||||||
<Meta />
|
<ColorScale color="mauve" />
|
||||||
<Analytics />
|
<ColorScale color="mauve" alpha />
|
||||||
<LocaleRedirector />
|
<ColorAlias color="mauve" alias="gray" />
|
||||||
<EasterEggs />
|
<ColorAlias color="mauve" alpha alias="gray" />
|
||||||
|
|
||||||
|
<ColorScale color="black" alpha />
|
||||||
|
<ColorScale color="white" alpha />
|
||||||
|
|
||||||
|
<ColorScale color={accent} />
|
||||||
|
<ColorScale color={accent} alpha />
|
||||||
|
<ColorAlias color={accent} alias="accent" />
|
||||||
|
<ColorAlias color={accent} alpha alias="accent" />
|
||||||
|
|
||||||
|
<BaseStyles />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 100dvh;
|
||||||
|
|
||||||
|
background-color: var(--gray-1);
|
||||||
|
color: var(--gray-12);
|
||||||
|
font-family: var(--font-family-regular);
|
||||||
|
|
||||||
|
.app {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
background-color: var(--gray-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const root = document.documentElement;
|
||||||
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
||||||
|
|
||||||
|
function applyTheme(e: MediaQueryList | MediaQueryListEvent) {
|
||||||
|
root.classList.toggle("dark", e.matches);
|
||||||
|
root.classList.toggle("light", !e.matches);
|
||||||
|
}
|
||||||
|
|
||||||
|
applyTheme(media);
|
||||||
|
media.addEventListener("change", applyTheme);
|
||||||
|
</script>
|
||||||
|
|
||||||
<slot name="head" />
|
<slot name="head" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class={noNavbar ? "no-navbar" : ""}>
|
<body>
|
||||||
<BlitzKitTheme>
|
<slot name="pre-app" />
|
||||||
<Flex direction="column" minHeight="100vh">
|
|
||||||
<Checks {locale} client:only="react" />
|
|
||||||
|
|
||||||
{servicing ? <Servicing /> : <slot />}
|
<div class="app">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
|
||||||
{!noFooter && <Footer {locale} />}
|
<!-- <Footer {locale} /> -->
|
||||||
</Flex>
|
|
||||||
</BlitzKitTheme>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
---
|
|
||||||
import { Box, Flex, Heading, Text } from "@radix-ui/themes";
|
|
||||||
import ToolOpenGraph from "../components/ToolOpenGraph.astro";
|
|
||||||
import type { Tool } from "../constants/tools";
|
|
||||||
import { getStrings } from "../core/i18n/getStrings";
|
|
||||||
import BaseLayout from "./BaseLayout.astro";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
tool: Tool;
|
|
||||||
locale: string;
|
|
||||||
noNavbar?: boolean;
|
|
||||||
noFooter?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { tool, locale, noNavbar, noFooter } = Astro.props;
|
|
||||||
const strings = getStrings(locale);
|
|
||||||
const toolStrings =
|
|
||||||
strings.website.tools[
|
|
||||||
(tool.strings ?? tool.id) as keyof typeof strings.website.tools
|
|
||||||
];
|
|
||||||
---
|
|
||||||
|
|
||||||
<ToolOpenGraph {locale} {tool} />
|
|
||||||
|
|
||||||
<BaseLayout {locale} {noNavbar} {noFooter}>
|
|
||||||
<Box
|
|
||||||
style={{
|
|
||||||
backgroundImage: `url(/assets/images/tools/${tool.id}.webp)`,
|
|
||||||
backgroundSize: "cover",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
direction="column"
|
|
||||||
align="center"
|
|
||||||
py="6"
|
|
||||||
style={{
|
|
||||||
backdropFilter: "blur(4rem)",
|
|
||||||
WebkitBackdropFilter: "blur(4rem)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Heading size="7">{toolStrings.name}</Heading>
|
|
||||||
<Text>{toolStrings.description}</Text>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
<slot />
|
|
||||||
</BaseLayout>
|
|
||||||
@@ -6,12 +6,9 @@ import { AesonPlug } from "../../../components/AesonPlug";
|
|||||||
import HelpTranslate from "../../../components/HelpTranslate.astro";
|
import HelpTranslate from "../../../components/HelpTranslate.astro";
|
||||||
import HomeCosmetics from "../../../components/HomeCosmetics.astro";
|
import HomeCosmetics from "../../../components/HomeCosmetics.astro";
|
||||||
import HomeGames from "../../../components/HomeGames.astro";
|
import HomeGames from "../../../components/HomeGames.astro";
|
||||||
import HomeHero from "../../../components/HomeHero.astro";
|
|
||||||
import HomePlayers from "../../../components/HomePlayers.astro";
|
import HomePlayers from "../../../components/HomePlayers.astro";
|
||||||
import HomeTanks from "../../../components/HomeTanks.astro";
|
import HomeTanks from "../../../components/HomeTanks.astro";
|
||||||
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
||||||
import { PageWrapper } from "../../../components/PageWrapper";
|
|
||||||
import { Plugs } from "../../../components/Plugs";
|
|
||||||
import { tools, type Tool } from "../../../constants/tools";
|
import { tools, type Tool } from "../../../constants/tools";
|
||||||
import { mixStaticPaths } from "../../../core/blitzkit/mixStaticPaths";
|
import { mixStaticPaths } from "../../../core/blitzkit/mixStaticPaths";
|
||||||
import { getStrings } from "../../../core/i18n/getStrings";
|
import { getStrings } from "../../../core/i18n/getStrings";
|
||||||
@@ -66,26 +63,16 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
|||||||
twitter={{ cardType: "summary_large_image" }}
|
twitter={{ cardType: "summary_large_image" }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseLayout {locale}>
|
<BaseLayout accent="blue" {locale}>
|
||||||
<HomeHero {locale} />
|
<!-- <HomeHero {locale} /> -->
|
||||||
|
|
||||||
<HelpTranslate {locale} />
|
<HelpTranslate {locale} />
|
||||||
|
|
||||||
<Plugs client:idle />
|
{environment === "preview" && <AesonPlug />}
|
||||||
|
|
||||||
{
|
|
||||||
environment === "preview" && (
|
|
||||||
<Flex justify="center" my="8" px="4">
|
|
||||||
<AesonPlug />
|
|
||||||
</Flex>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
<PageWrapper>
|
|
||||||
<HomeTanks {locale} />
|
<HomeTanks {locale} />
|
||||||
<HomePlayers {locale} />
|
<HomePlayers {locale} />
|
||||||
<HomeGames {locale} />
|
<HomeGames {locale} />
|
||||||
<HomeCosmetics {locale} />
|
<HomeCosmetics {locale} />
|
||||||
<HomeTechnical {locale} />
|
<HomeTechnical {locale} />
|
||||||
</PageWrapper>
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
Reference in new issue
Block a user