mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01:00
1 parent
0817ba18bd
commit
0828d50830
5 files changed
+12
-32
No files matched your search
@@ -43,10 +43,6 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|
||||||
:root.light & {
|
|
||||||
filter: brightness(1.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.gradient {
|
.gradient {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -62,10 +58,6 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
|
|
||||||
backdrop-filter: blur(var(--space-6));
|
backdrop-filter: blur(var(--space-6));
|
||||||
|
|
||||||
:root.light & {
|
|
||||||
backdrop-filter: blur(var(--space-6)) brightness(1.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.readable {
|
.readable {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { fetchPB } from "@blitzkit/core";
|
|||||||
import type { Strings } from "@blitzkit/i18n";
|
import type { Strings } from "@blitzkit/i18n";
|
||||||
import { Avatars } from "@protos/blitzkit/avatars";
|
import { Avatars } from "@protos/blitzkit/avatars";
|
||||||
import { PopularTanks } from "@protos/blitzkit/popular_tanks";
|
import { PopularTanks } from "@protos/blitzkit/popular_tanks";
|
||||||
import { Tank } from "@protos/blitzkit/tank";
|
|
||||||
import { TankList } from "@protos/blitzkit/tank_list";
|
import { TankList } from "@protos/blitzkit/tank_list";
|
||||||
|
import { Tanks } from "@protos/blitzkit/tanks";
|
||||||
import { AbstractAPI, Cache } from "./abstract";
|
import { AbstractAPI, Cache } from "./abstract";
|
||||||
|
|
||||||
const rejected = Promise.reject("Not implemented on client");
|
const rejected = Promise.reject("Not implemented on client");
|
||||||
@@ -15,13 +15,14 @@ export class ClientAPI extends AbstractAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Cache()
|
@Cache()
|
||||||
tank(id: string) {
|
async tank(id: string) {
|
||||||
return fetchPB(`/api/tanks/${id}.pb`, Tank);
|
const tanks = await this.tanks();
|
||||||
|
return tanks.tanks[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
@UnimplementedOnClient
|
@Cache()
|
||||||
tanks() {
|
tanks() {
|
||||||
return rejected;
|
return fetchPB("/api/tanks/all.pb", Tanks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cache()
|
@Cache()
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import type { APIContext } from "astro";
|
import type { APIContext, GetStaticPaths } from "astro";
|
||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
|
|
||||||
export { getStaticPaths } from "./[id].pb";
|
export const getStaticPaths = (async () => {
|
||||||
|
const { list } = await api.tankList();
|
||||||
|
return list.map(({ id }) => ({ params: { id } }));
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Even Noah can't save these animals.
|
* Even Noah can't save these animals.
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import { Tank } from "@protos/blitzkit/tank";
|
|
||||||
import type { APIContext, GetStaticPaths } from "astro";
|
|
||||||
import { api } from "../../../core/api/dynamic";
|
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
|
||||||
const { list } = await api.tankList();
|
|
||||||
return list.map(({ id }) => ({ params: { id } }));
|
|
||||||
}) satisfies GetStaticPaths;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Even Noah can't save these animals.
|
|
||||||
*/
|
|
||||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
|
||||||
const tank = await api.tank(params.id);
|
|
||||||
return new Response(Tank.encode(tank).finish());
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ import type { APIContext } from "astro";
|
|||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
import { game } from "../../../core/game/game";
|
import { game } from "../../../core/game/game";
|
||||||
|
|
||||||
export { getStaticPaths } from "./[id].pb";
|
export { getStaticPaths } from "./[id].json";
|
||||||
|
|
||||||
export async function GET({ params }: APIContext<never, { id: string }>) {
|
export async function GET({ params }: APIContext<never, { id: string }>) {
|
||||||
const tank = await api.tank(params.id);
|
const tank = await api.tank(params.id);
|
||||||
|
|||||||
Reference in new issue
Block a user