mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: landing page for mobile
This commit is contained in:
1 parent
437bbfdc89
commit
f36df9e902
2 files changed
+31
-6
No files matched your search
@@ -77,13 +77,14 @@ export function PlaylistGenerator({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
</AlertDialog.Content>
|
</AlertDialog.Content>
|
||||||
</AlertDialog.Root>
|
</AlertDialog.Root>
|
||||||
|
|
||||||
<Flex justify="center" width="100%" align="center">
|
<Flex justify="center" width="100%" align="center" px="4">
|
||||||
<Flex
|
<Flex
|
||||||
flexGrow="1"
|
flexGrow="1"
|
||||||
gap="9"
|
gap="9"
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
maxWidth="80rem"
|
maxWidth="80rem"
|
||||||
|
direction={{ initial: "column-reverse", md: "row" }}
|
||||||
>
|
>
|
||||||
<Flex direction="column" gap="4" align="center">
|
<Flex direction="column" gap="4" align="center">
|
||||||
<FilterControl />
|
<FilterControl />
|
||||||
@@ -109,6 +110,7 @@ export function PlaylistGenerator({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
flexBasis="0"
|
flexBasis="0"
|
||||||
align="center"
|
align="center"
|
||||||
gap="4"
|
gap="4"
|
||||||
|
width="100%"
|
||||||
>
|
>
|
||||||
<Grid
|
<Grid
|
||||||
columns="repeat(auto-fill, minmax(4rem, 1fr))"
|
columns="repeat(auto-fill, minmax(4rem, 1fr))"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
Popover,
|
Popover,
|
||||||
Text,
|
Text,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
type ButtonProps,
|
||||||
type FlexProps,
|
type FlexProps,
|
||||||
} from "@radix-ui/themes";
|
} from "@radix-ui/themes";
|
||||||
import { isEqual, times } from "lodash-es";
|
import { isEqual, times } from "lodash-es";
|
||||||
@@ -37,10 +38,6 @@ import { ResearchedIcon } from "../../ResearchedIcon";
|
|||||||
import { ScienceIcon } from "../../ScienceIcon";
|
import { ScienceIcon } from "../../ScienceIcon";
|
||||||
import { ScienceOffIcon } from "../../ScienceOffIcon";
|
import { ScienceOffIcon } from "../../ScienceOffIcon";
|
||||||
|
|
||||||
interface FilterControlProps {
|
|
||||||
compact?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gameDefinitions = await awaitableGameDefinitions;
|
const gameDefinitions = await awaitableGameDefinitions;
|
||||||
|
|
||||||
const shellTypeIcons: Record<ShellType, string> = {
|
const shellTypeIcons: Record<ShellType, string> = {
|
||||||
@@ -50,13 +47,21 @@ const shellTypeIcons: Record<ShellType, string> = {
|
|||||||
[ShellType.HEAT]: "hc",
|
[ShellType.HEAT]: "hc",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const size: ButtonProps["size"] = { initial: "1", xs: "2" };
|
||||||
|
|
||||||
function ShellFilter({ index, premium }: { index: number; premium?: boolean }) {
|
function ShellFilter({ index, premium }: { index: number; premium?: boolean }) {
|
||||||
const shells = TankFilters.use((state) => state.shells);
|
const shells = TankFilters.use((state) => state.shells);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover.Root>
|
<Popover.Root>
|
||||||
<Popover.Trigger>
|
<Popover.Trigger>
|
||||||
<IconButton variant="soft" radius="none" color="gray" highContrast>
|
<IconButton
|
||||||
|
size={size}
|
||||||
|
variant="soft"
|
||||||
|
radius="none"
|
||||||
|
color="gray"
|
||||||
|
highContrast
|
||||||
|
>
|
||||||
{shells[index] === null && (
|
{shells[index] === null && (
|
||||||
<Text color="gray" style={{ display: "contents" }}>
|
<Text color="gray" style={{ display: "contents" }}>
|
||||||
<MissingShellIcon width="1em" height="1em" />
|
<MissingShellIcon width="1em" height="1em" />
|
||||||
@@ -83,6 +88,7 @@ function ShellFilter({ index, premium }: { index: number; premium?: boolean }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={shellType}
|
key={shellType}
|
||||||
value={`${shellType}`}
|
value={`${shellType}`}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -127,6 +133,7 @@ function OwnershipFilter(props: FlexProps) {
|
|||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
disabled={!wargaming}
|
disabled={!wargaming}
|
||||||
variant={tankFilters.ownership === "all" ? "solid" : "soft"}
|
variant={tankFilters.ownership === "all" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -142,6 +149,7 @@ function OwnershipFilter(props: FlexProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
disabled={!wargaming}
|
disabled={!wargaming}
|
||||||
variant={tankFilters.ownership === "owned" ? "solid" : "soft"}
|
variant={tankFilters.ownership === "owned" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -157,6 +165,7 @@ function OwnershipFilter(props: FlexProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
disabled={!wargaming}
|
disabled={!wargaming}
|
||||||
variant={tankFilters.ownership === "unowned" ? "solid" : "soft"}
|
variant={tankFilters.ownership === "unowned" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -195,6 +204,7 @@ export function FilterControl() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={tier}
|
key={tier}
|
||||||
variant={selected ? "solid" : "soft"}
|
variant={selected ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -233,6 +243,7 @@ export function FilterControl() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={tier}
|
key={tier}
|
||||||
variant={selected ? "solid" : "soft"}
|
variant={selected ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -270,6 +281,7 @@ export function FilterControl() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={nation}
|
key={nation}
|
||||||
variant={selected ? "solid" : "soft"}
|
variant={selected ? "solid" : "soft"}
|
||||||
color={selected ? undefined : "gray"}
|
color={selected ? undefined : "gray"}
|
||||||
@@ -312,6 +324,7 @@ export function FilterControl() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={nation}
|
key={nation}
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
variant={selected ? "solid" : "soft"}
|
variant={selected ? "solid" : "soft"}
|
||||||
@@ -351,6 +364,7 @@ export function FilterControl() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
key={tankClass}
|
key={tankClass}
|
||||||
variant={selected ? "solid" : "soft"}
|
variant={selected ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
@@ -380,6 +394,7 @@ export function FilterControl() {
|
|||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={tankFilters.gunType.includes("regular") ? "solid" : "soft"}
|
variant={tankFilters.gunType.includes("regular") ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
color={tankFilters.gunType.includes("regular") ? undefined : "gray"}
|
color={tankFilters.gunType.includes("regular") ? undefined : "gray"}
|
||||||
@@ -397,6 +412,7 @@ export function FilterControl() {
|
|||||||
<GunRegularIcon style={{ width: "1em", height: "1em" }} />
|
<GunRegularIcon style={{ width: "1em", height: "1em" }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={
|
variant={
|
||||||
tankFilters.gunType.includes("auto_loader") ? "solid" : "soft"
|
tankFilters.gunType.includes("auto_loader") ? "solid" : "soft"
|
||||||
}
|
}
|
||||||
@@ -420,6 +436,7 @@ export function FilterControl() {
|
|||||||
<GunAutoloaderIcon style={{ width: "1em", height: "1em" }} />
|
<GunAutoloaderIcon style={{ width: "1em", height: "1em" }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={
|
variant={
|
||||||
tankFilters.gunType.includes("auto_reloader") ? "solid" : "soft"
|
tankFilters.gunType.includes("auto_reloader") ? "solid" : "soft"
|
||||||
}
|
}
|
||||||
@@ -460,6 +477,7 @@ export function FilterControl() {
|
|||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={
|
variant={
|
||||||
tankFilters.types?.includes(TankType.RESEARCHABLE)
|
tankFilters.types?.includes(TankType.RESEARCHABLE)
|
||||||
? "solid"
|
? "solid"
|
||||||
@@ -487,6 +505,7 @@ export function FilterControl() {
|
|||||||
<ResearchedIcon style={{ width: "1em", height: "1em" }} />
|
<ResearchedIcon style={{ width: "1em", height: "1em" }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={
|
variant={
|
||||||
tankFilters.types?.includes(TankType.PREMIUM) ? "solid" : "soft"
|
tankFilters.types?.includes(TankType.PREMIUM) ? "solid" : "soft"
|
||||||
}
|
}
|
||||||
@@ -519,6 +538,7 @@ export function FilterControl() {
|
|||||||
</Text>
|
</Text>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={
|
variant={
|
||||||
tankFilters.types?.includes(TankType.COLLECTOR) ? "solid" : "soft"
|
tankFilters.types?.includes(TankType.COLLECTOR) ? "solid" : "soft"
|
||||||
}
|
}
|
||||||
@@ -558,6 +578,7 @@ export function FilterControl() {
|
|||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={tankFilters.testing === "include" ? "solid" : "soft"}
|
variant={tankFilters.testing === "include" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
color={tankFilters.testing === "include" ? undefined : "gray"}
|
color={tankFilters.testing === "include" ? undefined : "gray"}
|
||||||
@@ -571,6 +592,7 @@ export function FilterControl() {
|
|||||||
<ComponentBooleanIcon />
|
<ComponentBooleanIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={tankFilters.testing === "exclude" ? "solid" : "soft"}
|
variant={tankFilters.testing === "exclude" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
color={tankFilters.testing === "exclude" ? undefined : "gray"}
|
color={tankFilters.testing === "exclude" ? undefined : "gray"}
|
||||||
@@ -586,6 +608,7 @@ export function FilterControl() {
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
size={size}
|
||||||
variant={tankFilters.testing === "only" ? "solid" : "soft"}
|
variant={tankFilters.testing === "only" ? "solid" : "soft"}
|
||||||
radius="none"
|
radius="none"
|
||||||
color={tankFilters.testing === "only" ? undefined : "gray"}
|
color={tankFilters.testing === "only" ? undefined : "gray"}
|
||||||
|
|||||||
Reference in new issue
Block a user