mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: move some
This commit is contained in:
1 parent
649cdd893f
commit
359dfcd102
9 files changed
+20
-55
No files matched your search
@@ -1,7 +1,4 @@
|
|||||||
import type { CatalogItemAccessor } from "@blitzkit/closed";
|
import type { CatalogItemAccessor } from "@blitzkit/closed";
|
||||||
import type { Tank } from "../../protos/tank";
|
|
||||||
import type { TankList } from "../../protos/tank_list";
|
|
||||||
import type { Tanks } from "../../protos/tanks";
|
|
||||||
|
|
||||||
export abstract class AbstractAPI {
|
export abstract class AbstractAPI {
|
||||||
abstract tanks(): Promise<Tanks>;
|
abstract tanks(): Promise<Tanks>;
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
|||||||
forEachChild,
|
forEachChild,
|
||||||
isFunctionDeclaration,
|
isFunctionDeclaration,
|
||||||
} from "typescript";
|
} from "typescript";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
const root = `/src/pages/api`;
|
const root = `/src/pages/api`;
|
||||||
const globbed = import.meta.glob("/src/pages/api/**/*.ts", {
|
const globbed = import.meta.glob("/src/pages/api/**/*.ts", {
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
import { ProfileAvatarComponent_Category } from "@protos/blitz_static_profile_avatar_component";
|
import { ProfileAvatarComponent_Category } from "@protos/blitz_static_profile_avatar_component";
|
||||||
import { Grade } from "@protos/blitz_static_standard_grades_enum";
|
import { Grade } from "@protos/blitz_static_standard_grades_enum";
|
||||||
import { api } from "../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
const avatars = await api.avatars();
|
const avatars = await api.avatars();
|
||||||
---
|
---
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import { Grade } from "@protos/blitz_static_standard_grades_enum";
|
import { Grade } from "@protos/blitz_static_standard_grades_enum";
|
||||||
import { api } from "../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
const backgrounds = await api.backgrounds();
|
const backgrounds = await api.backgrounds();
|
||||||
---
|
---
|
||||||
File renamed without changes.
+11
-8
@@ -1,13 +1,16 @@
|
|||||||
import { times } from "lodash-es";
|
import { times } from "lodash-es";
|
||||||
import { Suspense, useMemo } from "react";
|
import { Suspense, useMemo } from "react";
|
||||||
import { TankopediaCharacteristic } from "../../../components/TankopediaCharacteristic";
|
import { TankopediaCharacteristic } from "../../../../components/TankopediaCharacteristic";
|
||||||
import { TankopediaToy } from "../../../components/TankopediaToy";
|
import { TankopediaToy } from "../../../../components/TankopediaToy";
|
||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../../core/api/dynamic";
|
||||||
import { characteristicsOrder } from "../../../core/tankopedia/characteristicsOrder";
|
import { characteristicsOrder } from "../../../../core/tankopedia/characteristicsOrder";
|
||||||
import { computeCharacteristics } from "../../../core/tankopedia/computeCharacteristics";
|
import { computeCharacteristics } from "../../../../core/tankopedia/computeCharacteristics";
|
||||||
import { TerrainHardness } from "../../../core/tankopedia/tankState";
|
import type { TerrainHardness } from "../../../../core/tankopedia/tankState";
|
||||||
import { useAwait } from "../../../hooks/useAwait";
|
import { useAwait } from "../../../../hooks/useAwait";
|
||||||
import { Tankopedia, TankopediaCompare } from "../../../stores/tankopedia";
|
import {
|
||||||
|
Tankopedia,
|
||||||
|
type TankopediaCompare,
|
||||||
|
} from "../../../../stores/tankopedia";
|
||||||
|
|
||||||
export function Page({ id }: { id: string }) {
|
export function Page({ id }: { id: string }) {
|
||||||
return (
|
return (
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
import "@radix-ui/colors/violet-dark.css";
|
import "@radix-ui/colors/violet-dark.css";
|
||||||
import type { GetStaticPaths } from "astro";
|
import type { GetStaticPaths } from "astro";
|
||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../../core/api/dynamic";
|
||||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||||
import { Page } from "./_index";
|
import { Page } from "./_index";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import "@radix-ui/colors/violet-dark.css";
|
import "@radix-ui/colors/violet-dark.css";
|
||||||
import { api } from "../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
const tankList = await api.tankList();
|
const tankList = await api.tankList();
|
||||||
---
|
---
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import * as colors from "@radix-ui/colors";
|
|
||||||
import type { APIContext, GetStaticPaths } from "astro";
|
|
||||||
|
|
||||||
const ignoreEndings = ["A", "P3", "Dark", "DarkA", "DarkP3"] as const;
|
|
||||||
|
|
||||||
const filtered = Object.keys(colors).filter(
|
|
||||||
(name) =>
|
|
||||||
!ignoreEndings.some((ending) => name.endsWith(ending)) &&
|
|
||||||
name !== "__esModule"
|
|
||||||
);
|
|
||||||
|
|
||||||
export const getStaticPaths = (() => {
|
|
||||||
return filtered.map((accent) => ({
|
|
||||||
params: { accent },
|
|
||||||
}));
|
|
||||||
}) satisfies GetStaticPaths;
|
|
||||||
|
|
||||||
export type Color = Exclude<
|
|
||||||
keyof typeof colors,
|
|
||||||
`${string}${(typeof ignoreEndings)[number]}` | "__esModule"
|
|
||||||
>;
|
|
||||||
|
|
||||||
export async function GET({ params }: APIContext<{}, { accent: Color }>) {
|
|
||||||
const palette = colors[`${params.accent}Dark`];
|
|
||||||
let content = ":root{";
|
|
||||||
|
|
||||||
for (const key in palette) {
|
|
||||||
const dashedKey = key.replace(/([a-zA-Z])(\d+)/, "$1-$2");
|
|
||||||
content += `--${dashedKey}:${palette[key as keyof typeof palette]};`;
|
|
||||||
}
|
|
||||||
|
|
||||||
content += "}";
|
|
||||||
|
|
||||||
return new Response(content);
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user