mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-07 01:40:38 +01:00
at least it runs
This commit is contained in:
1 parent
9ba19a425c
commit
da3ad0aa1b
4 files changed
+38
-23
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
.Trigger {
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { AlertDialog as _ } from "radix-ui";
|
||||||
|
import { composeRadixComponents } from "../../ui/compose";
|
||||||
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
|
export const AlertDialog = composeRadixComponents(_, styles);
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import { useModel } from "../hooks/useModel";
|
import { useModel } from "../hooks/useModel";
|
||||||
import { Guess, GuessState } from "../stores/guess";
|
import { Guess, GuessState } from "../stores/guess";
|
||||||
|
import { CanvasControl } from "./CanvasControl";
|
||||||
import { Lighting } from "./Lighting";
|
import { Lighting } from "./Lighting";
|
||||||
|
import { SceneProps } from "./SceneProps";
|
||||||
import { SmartCanvas } from "./SmartCanvas";
|
import { SmartCanvas } from "./SmartCanvas";
|
||||||
import { TankModel } from "./TankModel";
|
import { TankModel } from "./TankModel";
|
||||||
|
|
||||||
@@ -12,7 +14,7 @@ export function GuessRenderer() {
|
|||||||
const helpingReveal = Guess.use((state) => state.helpingReveal);
|
const helpingReveal = Guess.use((state) => state.helpingReveal);
|
||||||
const isRevealed = helpingReveal || guessState !== GuessState.NotGuessed;
|
const isRevealed = helpingReveal || guessState !== GuessState.NotGuessed;
|
||||||
|
|
||||||
const id = Guess.use((state) => state.tank.id);
|
const id = Guess.use((state) => state.tank);
|
||||||
const { hasPbr } = useModel(id);
|
const { hasPbr } = useModel(id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -26,7 +28,8 @@ export function GuessRenderer() {
|
|||||||
}}
|
}}
|
||||||
camera={{ position: [-5, 5, -5] }}
|
camera={{ position: [-5, 5, -5] }}
|
||||||
>
|
>
|
||||||
<Controls zoomable={false} />
|
<SceneProps />
|
||||||
|
<CanvasControl zoomable={false} />
|
||||||
<Lighting hasPbr={hasPbr} />
|
<Lighting hasPbr={hasPbr} />
|
||||||
<TankModel />
|
<TankModel />
|
||||||
</SmartCanvas>
|
</SmartCanvas>
|
||||||
|
|||||||
@@ -19,8 +19,15 @@ import { awaitableTiers } from "../core/awaitables/tiers";
|
|||||||
import { useStrings } from "../hooks/useStrings";
|
import { useStrings } from "../hooks/useStrings";
|
||||||
import { useUnwrapper } from "../hooks/useUnwrapper";
|
import { useUnwrapper } from "../hooks/useUnwrapper";
|
||||||
import { Guess, GuessState } from "../stores/guess";
|
import { Guess, GuessState } from "../stores/guess";
|
||||||
|
import { AlertDialog } from "./AlertDialog";
|
||||||
|
import { Button } from "./Button";
|
||||||
import { ClassIcon } from "./ClassIcon";
|
import { ClassIcon } from "./ClassIcon";
|
||||||
|
import { DropdownMenu } from "./DropdownMenu";
|
||||||
|
import { IconButton } from "./IconButton";
|
||||||
import { SearchResults } from "./SearchResults";
|
import { SearchResults } from "./SearchResults";
|
||||||
|
import { Spinner } from "./Spinner";
|
||||||
|
import { Text } from "./Text";
|
||||||
|
import { TextField } from "./TextField";
|
||||||
|
|
||||||
const { go } = fuzzysort;
|
const { go } = fuzzysort;
|
||||||
|
|
||||||
@@ -98,7 +105,7 @@ export function Guesser() {
|
|||||||
}, [correctGuesses, totalGuesses, streak]);
|
}, [correctGuesses, totalGuesses, streak]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<div
|
||||||
direction="column"
|
direction="column"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
bottom="0"
|
bottom="0"
|
||||||
@@ -109,14 +116,14 @@ export function Guesser() {
|
|||||||
maxWidth="25rem"
|
maxWidth="25rem"
|
||||||
gap="3"
|
gap="3"
|
||||||
>
|
>
|
||||||
<Box position="relative">
|
<div position="relative">
|
||||||
{results !== null && (
|
{results !== null && (
|
||||||
<Card variant="classic">
|
<Card variant="classic">
|
||||||
<Box py="2" px="3">
|
<div py="2" px="3">
|
||||||
{results.length === 0 && (
|
{results.length === 0 && (
|
||||||
<Flex justify="center">
|
<div justify="center">
|
||||||
<Text color="gray">{strings.common.search.no_results}</Text>
|
<Text color="gray">{strings.common.search.no_results}</Text>
|
||||||
</Flex>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<SearchResults.Root>
|
<SearchResults.Root>
|
||||||
@@ -142,7 +149,7 @@ export function Guesser() {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
discriminator={
|
discriminator={
|
||||||
<Flex
|
<div
|
||||||
align="center"
|
align="center"
|
||||||
gap="1"
|
gap="1"
|
||||||
width="38px"
|
width="38px"
|
||||||
@@ -154,22 +161,22 @@ export function Guesser() {
|
|||||||
height="1em"
|
height="1em"
|
||||||
/>
|
/>
|
||||||
{romanize(result.tier)}
|
{romanize(result.tier)}
|
||||||
</Flex>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</SearchResults.Root>
|
</SearchResults.Root>
|
||||||
</Box>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</div>
|
||||||
|
|
||||||
<Flex justify="center" style={{ userSelect: "none" }}>
|
<div justify="center" style={{ userSelect: "none" }}>
|
||||||
<Text ref={status} />
|
<Text ref={status} />
|
||||||
</Flex>
|
</div>
|
||||||
|
|
||||||
<Flex gap={{ initial: "2", sm: "3" }}>
|
<div gap={{ initial: "2", sm: "3" }}>
|
||||||
<DropdownMenu.Root modal={false}>
|
<DropdownMenu.Root modal={false}>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -240,7 +247,7 @@ export function Guesser() {
|
|||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Root>
|
</DropdownMenu.Root>
|
||||||
|
|
||||||
<TextField.Root
|
<TextField
|
||||||
disabled={guessState !== GuessState.NotGuessed}
|
disabled={guessState !== GuessState.NotGuessed}
|
||||||
ref={input}
|
ref={input}
|
||||||
onChange={requestSearch}
|
onChange={requestSearch}
|
||||||
@@ -249,10 +256,8 @@ export function Guesser() {
|
|||||||
size={{ initial: "2", sm: "3" }}
|
size={{ initial: "2", sm: "3" }}
|
||||||
variant="classic"
|
variant="classic"
|
||||||
>
|
>
|
||||||
<TextField.Slot>
|
{searching ? <Spinner /> : <MagnifyingGlassIcon />}
|
||||||
{searching ? <Spinner /> : <MagnifyingGlassIcon />}
|
</TextField>
|
||||||
</TextField.Slot>
|
|
||||||
</TextField.Root>
|
|
||||||
|
|
||||||
<AlertDialog.Root>
|
<AlertDialog.Root>
|
||||||
<AlertDialog.Trigger>
|
<AlertDialog.Trigger>
|
||||||
@@ -270,7 +275,7 @@ export function Guesser() {
|
|||||||
{strings.guesser.help.description}
|
{strings.guesser.help.description}
|
||||||
</AlertDialog.Description>
|
</AlertDialog.Description>
|
||||||
|
|
||||||
<Flex justify="end" gap="2">
|
<div justify="end" gap="2">
|
||||||
<AlertDialog.Cancel>
|
<AlertDialog.Cancel>
|
||||||
<Button variant="outline">{strings.guesser.help.cancel}</Button>
|
<Button variant="outline">{strings.guesser.help.cancel}</Button>
|
||||||
</AlertDialog.Cancel>
|
</AlertDialog.Cancel>
|
||||||
@@ -288,7 +293,7 @@ export function Guesser() {
|
|||||||
{strings.guesser.help.reveal}
|
{strings.guesser.help.reveal}
|
||||||
</Button>
|
</Button>
|
||||||
</AlertDialog.Action>
|
</AlertDialog.Action>
|
||||||
</Flex>
|
</div>
|
||||||
</AlertDialog.Content>
|
</AlertDialog.Content>
|
||||||
</AlertDialog.Root>
|
</AlertDialog.Root>
|
||||||
|
|
||||||
@@ -347,7 +352,7 @@ export function Guesser() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</div>
|
||||||
</Flex>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user