mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-21 12:53:56 +01:00
Merge branch 'main' into data-driven
This commit is contained in:
commit
1b08393f65
60 files changed
+434
-474
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import sharp from "sharp";
|
||||
import type { APIContext, GetStaticPathsItem } from "astro";
|
||||
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
|
||||
import { vfs } from "../../../../core/blitzkit/vfs";
|
||||
@@ -29,7 +30,10 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
});
|
||||
|
||||
export async function GET({ props }: APIContext<{ path: string }>) {
|
||||
const bytes = new Uint8Array(await vfs.file(props.path));
|
||||
const bytes = await sharp(new Uint8Array(await vfs.file(props.path)))
|
||||
.trim({ background: { r: 0, g: 0, b: 0, alpha: 0 }, threshold: 1 })
|
||||
.webp()
|
||||
.toBuffer();
|
||||
|
||||
return new Response(bytes);
|
||||
return new Response(new Uint8Array(bytes));
|
||||
}
|
||||
@@ -94,7 +94,7 @@ function ModuleChooser({
|
||||
<Dialog.Trigger>
|
||||
<Button
|
||||
variant="surface"
|
||||
size={{ initial: "3", md: "4" }}
|
||||
size={{ initial: "2", xs: "3", md: "4" }}
|
||||
style={{
|
||||
overflow: "clip",
|
||||
borderTopRightRadius: subSelector ? 0 : undefined,
|
||||
@@ -137,7 +137,7 @@ function ModuleChooser({
|
||||
<Popover.Trigger>
|
||||
<IconButton
|
||||
variant="surface"
|
||||
size={{ initial: "3", md: "4" }}
|
||||
size={{ initial: "2", xs: "3", md: "4" }}
|
||||
style={{
|
||||
overflow: "clip",
|
||||
borderTopLeftRadius: 0,
|
||||
@@ -204,7 +204,7 @@ function ModuleChooser({
|
||||
|
||||
function ModuleSeparator() {
|
||||
return (
|
||||
<Text size="5" color="gray" trim="end">
|
||||
<Text size={{ initial: "3", xs: "5" }} color="gray" trim="end">
|
||||
<CaretRightIcon width="1em" height="1em" />
|
||||
</Text>
|
||||
);
|
||||
@@ -260,7 +260,7 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
</Button>
|
||||
</Flex>
|
||||
|
||||
<Flex gap="2" align="center">
|
||||
<Flex gap={{ initial: "1", xs: "2" }} align="center">
|
||||
<ModuleChooser
|
||||
skeleton={skeleton}
|
||||
tank={hullTankId.id}
|
||||
|
||||
@@ -18,6 +18,10 @@ export function Page({ locale }: LocaleAcceptorProps) {
|
||||
|
||||
function Content({ locale }: LocaleAcceptorProps) {
|
||||
const developerMode = App.useDeferred((state) => state.developerMode, false);
|
||||
const autoLoadModels = App.useDeferred(
|
||||
(state) => state.autoLoadModels,
|
||||
true,
|
||||
);
|
||||
const { strings } = useLocale();
|
||||
|
||||
return (
|
||||
@@ -36,6 +40,19 @@ function Content({ locale }: LocaleAcceptorProps) {
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
<Flex align="center" gap="2" justify="between">
|
||||
<Text>{strings.website.settings.auto_load_models}</Text>
|
||||
<Switch
|
||||
variant="classic"
|
||||
checked={autoLoadModels}
|
||||
onCheckedChange={(checked) =>
|
||||
App.mutate((draft) => {
|
||||
draft.autoLoadModels = checked;
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
<Flex align="center" gap="2" justify="between">
|
||||
<Text>{strings.website.settings.language}</Text>
|
||||
<LocaleSwitcher locale={locale} />
|
||||
|
||||
Reference in new issue
Block a user