feat: home page tools

This commit is contained in:
TrèsAbhi committed 2026-01-25 16:13:36 -06:00
1 parent 1dc9a341d1
commit 0bc2d0aaf6
8 files changed
+53 -33

No files matched your search

-3
View File
@@ -41,9 +41,6 @@
"action": "To docs", "action": "To docs",
"slogan": "BlitzKit hosted API" "slogan": "BlitzKit hosted API"
}, },
"settings": {
"name": "Settings"
},
"players": { "players": {
"name": "Players", "name": "Players",
"slogan": "Player statistics", "slogan": "Player statistics",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 453 KiB

@@ -14,6 +14,11 @@ export const LIGHT_TEXT_COLORS = new Set<Color>([
"teal", "teal",
"grass", "grass",
"amber", "amber",
"plum",
"pink",
"brown",
"crimson",
"jade",
]); ]);
export function Button({ export function Button({
@@ -21,9 +21,11 @@ const strings = await api.strings(locale);
flex-direction: column; flex-direction: column;
justify-content: end; justify-content: end;
align-items: center; align-items: center;
padding: 0 var(--space-4);
position: relative; position: relative;
padding: 0 var(--space-4);
margin-bottom: var(--space-4);
.wallpaper { .wallpaper {
position: absolute; position: absolute;
top: 0; top: 0;
@@ -29,6 +29,11 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
background-position: center; background-position: center;
overflow: hidden; overflow: hidden;
&[data-significant="true"] {
grid-column: 1 / -1;
height: 15rem;
}
.poster { .poster {
flex: 1; flex: 1;
@@ -59,6 +64,7 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
style={{ style={{
backgroundImage: `url(/assets/tools/${tool.id}.webp)`, backgroundImage: `url(/assets/tools/${tool.id}.webp)`,
}} }}
data-significant={tool.significant}
> >
<div <div
class="poster" class="poster"
@@ -74,7 +80,7 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
<Text size="minor" lowContrast>{toolStrings.slogan}</Text> <Text size="minor" lowContrast>{toolStrings.slogan}</Text>
</div> </div>
<Button color={tool.button}> <Button color={tool.accent}>
{toolStrings.action} {toolStrings.action}
<CaretRightIcon /> <CaretRightIcon />
</Button> </Button>
+16 -21
View File
@@ -3,6 +3,7 @@ import type { Color } from "../ui/color";
export interface Tool { export interface Tool {
id: string; id: string;
significant?: boolean;
accent: Color; accent: Color;
banner_background_position: "top" | "center" | "bottom"; banner_background_position: "top" | "center" | "bottom";
} }
@@ -11,22 +12,30 @@ export const tools: Record<string, Tool> = {
tanks: { tanks: {
id: "tanks", id: "tanks",
accent: "purple", significant: true,
accent: "plum",
banner_background_position: "top", banner_background_position: "top",
}, },
players: { players: {
id: "players", id: "players",
accent: "purple", accent: "pink",
banner_background_position: "top", banner_background_position: "top",
}, },
settings: { compare: {
id: "settings", id: "compare",
accent: "gray", accent: "crimson",
banner_background_position: "top", banner_background_position: "bottom",
},
performance: {
id: "performance",
accent: "jade",
banner_background_position: "bottom",
}, },
avatars: { avatars: {
@@ -46,21 +55,7 @@ export const tools: Record<string, Tool> = {
api: { api: {
id: "api", id: "api",
accent: "lime", accent: "brown",
banner_background_position: "bottom",
},
compare: {
id: "compare",
accent: "crimson",
banner_background_position: "bottom",
},
performance: {
id: "performance",
accent: "jade",
banner_background_position: "bottom", banner_background_position: "bottom",
}, },
@@ -1,8 +1,11 @@
--- ---
import locales from "@blitzkit/i18n/locales.json"; import locales from "@blitzkit/i18n/locales.json";
import type { GetStaticPaths } from "astro"; import type { GetStaticPaths } from "astro";
import ColorScale from "../../components/ColorScale.astro";
import HomeHero from "../../components/HomeHero.astro"; import HomeHero from "../../components/HomeHero.astro";
import { RecentItems } from "../../components/RecentItems"; import { Section } from "../../components/Section";
import ToolCard from "../../components/ToolCard.astro";
import { tools } from "../../core/tools/tools";
import BaseLayout from "../../layouts/BaseLayout.astro"; import BaseLayout from "../../layouts/BaseLayout.astro";
export const getStaticPaths = (() => { export const getStaticPaths = (() => {
@@ -17,14 +20,26 @@ export const getStaticPaths = (() => {
const { locale } = Astro.props; const { locale } = Astro.props;
--- ---
<style>
.tools {
display: grid;
gap: var(--space-4);
grid-template-columns: repeat(2, 1fr);
}
</style>
<BaseLayout {locale} accent="amber"> <BaseLayout {locale} accent="amber">
<HomeHero {locale} /> <HomeHero {locale} />
<RecentItems {locale} client:only="react"> {Object.values(tools).map((tool) => <ColorScale color={tool.accent} />)}
<RecentItems {locale} skeleton slot="fallback" />
</RecentItems>
<!-- <Section> <!-- <RecentItems {locale} client:only="react">
{Object.values(tools).map((tool) => <ToolCard {locale} {tool} />)} <RecentItems {locale} skeleton slot="fallback" />
</Section> --> </RecentItems> -->
<Section>
<div class="tools">
{Object.values(tools).map((tool) => <ToolCard {locale} {tool} />)}
</div>
</Section>
</BaseLayout> </BaseLayout>