mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: minor adjusments
This commit is contained in:
1 parent
71e40a0113
commit
6b29584424
1 file changed
+6
-18
@@ -48,14 +48,13 @@ const GUN_TYPES = Object.keys(
|
|||||||
GUN_TYPE_ICONS
|
GUN_TYPE_ICONS
|
||||||
) as (keyof typeof GUN_TYPE_ICONS)[];
|
) as (keyof typeof GUN_TYPE_ICONS)[];
|
||||||
|
|
||||||
const MAX_NATIONS = 3;
|
const MAX_TIERS = 4;
|
||||||
const MAX_TIERS = 2;
|
|
||||||
|
|
||||||
const TIERS = times(10, (i) => 10 - i);
|
const TIERS = times(10, (i) => 10 - i);
|
||||||
|
|
||||||
export function FilterControl() {
|
export function FilterControl() {
|
||||||
return (
|
return (
|
||||||
<Flex align="center" gap="2">
|
<Flex align="center" gap="2" wrap="wrap">
|
||||||
<TiersFilter />
|
<TiersFilter />
|
||||||
<NationsFilter />
|
<NationsFilter />
|
||||||
<TypeFilter />
|
<TypeFilter />
|
||||||
@@ -73,7 +72,6 @@ function TiersFilter() {
|
|||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<Button color="gray" variant="surface">
|
<Button color="gray" variant="surface">
|
||||||
Tiers
|
|
||||||
<Flex gap="1">
|
<Flex gap="1">
|
||||||
{tiers.slice(0, MAX_TIERS).map((tier) => (
|
{tiers.slice(0, MAX_TIERS).map((tier) => (
|
||||||
<Text size="1" key={tier}>
|
<Text size="1" key={tier}>
|
||||||
@@ -143,9 +141,8 @@ function NationsFilter() {
|
|||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<Button color="gray" variant="surface">
|
<Button color="gray" variant="surface">
|
||||||
Nations
|
|
||||||
<Flex>
|
<Flex>
|
||||||
{nations.slice(0, MAX_NATIONS).map((nation, index) => (
|
{nations.map((nation, index) => (
|
||||||
<img
|
<img
|
||||||
style={{
|
style={{
|
||||||
filter: "drop-shadow(0 0 var(--space-1) var(--black-a11))",
|
filter: "drop-shadow(0 0 var(--space-1) var(--black-a11))",
|
||||||
@@ -156,12 +153,6 @@ function NationsFilter() {
|
|||||||
src={asset(`flags/circle/${nation}.webp`)}
|
src={asset(`flags/circle/${nation}.webp`)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{nations.length > MAX_NATIONS && (
|
|
||||||
<Text size="1" ml="1">
|
|
||||||
+{nations.length - MAX_NATIONS}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenu.Trigger>
|
</DropdownMenu.Trigger>
|
||||||
@@ -253,7 +244,6 @@ function ClassFilter() {
|
|||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<Button color="gray" variant="surface">
|
<Button color="gray" variant="surface">
|
||||||
Classes
|
|
||||||
<Flex>
|
<Flex>
|
||||||
{classes.map((tankClass, index) => {
|
{classes.map((tankClass, index) => {
|
||||||
const Icon = classIcons[tankClass];
|
const Icon = classIcons[tankClass];
|
||||||
@@ -334,14 +324,14 @@ function GunTypeFilter() {
|
|||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<Button color="gray" variant="surface">
|
<Button color="gray" variant="surface">
|
||||||
Gun types
|
<Flex>
|
||||||
<Flex ml="-1">
|
|
||||||
{gunTypes.map((gunType) => {
|
{gunTypes.map((gunType) => {
|
||||||
const Icon = GUN_TYPE_ICONS[gunType];
|
const Icon = GUN_TYPE_ICONS[gunType];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Icon
|
<Icon
|
||||||
style={{
|
style={{
|
||||||
|
margin: gunType === "regular" ? "0 -0.125em" : undefined,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
color: "var(--gray-12)",
|
color: "var(--gray-12)",
|
||||||
width: "1.25em",
|
width: "1.25em",
|
||||||
@@ -412,8 +402,7 @@ function TypeFilter() {
|
|||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<Button color="gray" variant="surface">
|
<Button color="gray" variant="surface">
|
||||||
Types
|
<Flex gap="1">
|
||||||
<Flex>
|
|
||||||
{types.map((tankType, index) => {
|
{types.map((tankType, index) => {
|
||||||
return (
|
return (
|
||||||
<ResearchedIcon
|
<ResearchedIcon
|
||||||
@@ -421,7 +410,6 @@ function TypeFilter() {
|
|||||||
color: `var(--${TANK_TYPE_COLORS[tankType]}-${
|
color: `var(--${TANK_TYPE_COLORS[tankType]}-${
|
||||||
tankType === TankType.RESEARCHABLE ? "12" : "11"
|
tankType === TankType.RESEARCHABLE ? "12" : "11"
|
||||||
})`,
|
})`,
|
||||||
marginLeft: index > 0 ? "-0.25em" : undefined,
|
|
||||||
filter: "drop-shadow(0 0 var(--space-1) var(--black-a11))",
|
filter: "drop-shadow(0 0 var(--space-1) var(--black-a11))",
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
width: "1.25em",
|
width: "1.25em",
|
||||||
|
|||||||
Reference in new issue
Block a user