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