mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: skip
This commit is contained in:
1 parent
4165533838
commit
fbbfa5307c
4 files changed
+24
-8
No files matched your search
@@ -860,6 +860,7 @@
|
|||||||
"seo_description": "Play a tank guessing game with a silhouette in World of Tanks Blitz",
|
"seo_description": "Play a tank guessing game with a silhouette in World of Tanks Blitz",
|
||||||
"search": {
|
"search": {
|
||||||
"placeholder": "Type to guess...",
|
"placeholder": "Type to guess...",
|
||||||
|
"skip": "Skip",
|
||||||
"guess": "Guess",
|
"guess": "Guess",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
"no_results": "No results"
|
"no_results": "No results"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export function PageWrapper({
|
|||||||
style={{
|
style={{
|
||||||
flex: noFlex1 ? undefined : 1,
|
flex: noFlex1 ? undefined : 1,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
minHeight: noMinHeight ? 'unset' : `calc(100dvh - ${NAVBAR_HEIGHT}px)`,
|
minHeight: noMinHeight ? 'unset' : `calc(100svh - ${NAVBAR_HEIGHT}px)`,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
...containerProps?.style,
|
...containerProps?.style,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -48,7 +48,15 @@ export function Background() {
|
|||||||
: 'tomato-3',
|
: 'tomato-3',
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Box
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
style={{
|
||||||
|
background: `radial-gradient(circle, ${Var('color-panel-translucent')}, ${Var('color-panel-solid')})`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
className="guess-background"
|
className="guess-background"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import fuzzysort from 'fuzzysort';
|
import fuzzysort from 'fuzzysort';
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { classIcons } from '../../../../../components/ClassIcon';
|
import { classIcons } from '../../../../../components/ClassIcon';
|
||||||
import { SearchResults } from '../../../../../components/SearchResults';
|
import { SearchResults } from '../../../../../components/SearchResults';
|
||||||
import { awaitableTankDefinitions } from '../../../../../core/awaitables/tankDefinitions';
|
import { awaitableTankDefinitions } from '../../../../../core/awaitables/tankDefinitions';
|
||||||
@@ -78,6 +78,10 @@ export function Guesser() {
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (guessState !== null) setSelected(null);
|
||||||
|
}, [guessState]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
direction="column"
|
direction="column"
|
||||||
@@ -160,11 +164,10 @@ export function Guesser() {
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
size="3"
|
size="3"
|
||||||
disabled={guessState === null && selected === null}
|
color={guessState === null && selected === null ? 'red' : undefined}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (guessState === null) {
|
if (guessState === null) {
|
||||||
console.log('what');
|
const correct = selected !== null && selected.id === tank.id;
|
||||||
const correct = selected!.id === tank.id;
|
|
||||||
|
|
||||||
mutateGuessEphemeral((draft) => {
|
mutateGuessEphemeral((draft) => {
|
||||||
draft.guessState = correct;
|
draft.guessState = correct;
|
||||||
@@ -187,8 +190,12 @@ export function Guesser() {
|
|||||||
>
|
>
|
||||||
{guessState === null ? (
|
{guessState === null ? (
|
||||||
<>
|
<>
|
||||||
{strings.website.tools.guess.search.guess}
|
{
|
||||||
<PaperPlaneIcon />
|
strings.website.tools.guess.search[
|
||||||
|
selected === null ? 'skip' : 'guess'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{selected === null ? <ArrowRightIcon /> : <PaperPlaneIcon />}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in new issue
Block a user