mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
Fix: mixer buttons clipping at the screen edges on small phones
The mixer's hull/turret/gun row is about 440px wide at its fixed sizes and is centered with `left: 50%` and `translateX(-50%)`, so on phones narrower than that it overflowed past both edges. Use smaller button sizes on phones and scale the tank images with the viewport (`clamp(2rem, 11vw, 4em)`), with smaller separators and gaps. From 520px up the layout is unchanged.
This commit is contained in:
1 parent
f3e8cdd5e0
commit
6907e5fb7a
1 file changed
+7
-7
@@ -94,7 +94,7 @@ function ModuleChooser({
|
|||||||
<Dialog.Trigger>
|
<Dialog.Trigger>
|
||||||
<Button
|
<Button
|
||||||
variant="surface"
|
variant="surface"
|
||||||
size={{ initial: "3", md: "4" }}
|
size={{ initial: "2", xs: "3", md: "4" }}
|
||||||
style={{
|
style={{
|
||||||
overflow: "clip",
|
overflow: "clip",
|
||||||
borderTopRightRadius: subSelector ? 0 : undefined,
|
borderTopRightRadius: subSelector ? 0 : undefined,
|
||||||
@@ -103,12 +103,12 @@ function ModuleChooser({
|
|||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{skeleton ? (
|
{skeleton ? (
|
||||||
<Skeleton width="4em" height="2em" />
|
<Skeleton width="clamp(2rem, 11vw, 4em)" height="2em" />
|
||||||
) : (
|
) : (
|
||||||
<img
|
<img
|
||||||
style={{
|
style={{
|
||||||
width: "4em",
|
width: "clamp(2rem, 11vw, 4em)",
|
||||||
height: "4em",
|
height: "clamp(2rem, 11vw, 4em)",
|
||||||
objectFit: "contain",
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
src={alias("api", `/tanks/${tank}/icons/big.webp`)}
|
src={alias("api", `/tanks/${tank}/icons/big.webp`)}
|
||||||
@@ -137,7 +137,7 @@ function ModuleChooser({
|
|||||||
<Popover.Trigger>
|
<Popover.Trigger>
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="surface"
|
variant="surface"
|
||||||
size={{ initial: "3", md: "4" }}
|
size={{ initial: "2", xs: "3", md: "4" }}
|
||||||
style={{
|
style={{
|
||||||
overflow: "clip",
|
overflow: "clip",
|
||||||
borderTopLeftRadius: 0,
|
borderTopLeftRadius: 0,
|
||||||
@@ -204,7 +204,7 @@ function ModuleChooser({
|
|||||||
|
|
||||||
function ModuleSeparator() {
|
function ModuleSeparator() {
|
||||||
return (
|
return (
|
||||||
<Text size="5" color="gray" trim="end">
|
<Text size={{ initial: "3", xs: "5" }} color="gray" trim="end">
|
||||||
<CaretRightIcon width="1em" height="1em" />
|
<CaretRightIcon width="1em" height="1em" />
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
@@ -260,7 +260,7 @@ function Content({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="2" align="center">
|
<Flex gap={{ initial: "1", xs: "2" }} align="center">
|
||||||
<ModuleChooser
|
<ModuleChooser
|
||||||
skeleton={skeleton}
|
skeleton={skeleton}
|
||||||
tank={hullTankId.id}
|
tank={hullTankId.id}
|
||||||
|
|||||||
Reference in new issue
Block a user