feat: more responsive

This commit is contained in:
TrèsAbhi committed 2024-01-26 22:44:15 -06:00
1 parent 8d1745d47e
commit ea68c8e82c
4 files changed
+42 -49

No files matched your search

@@ -1,5 +1,5 @@
import { Flex } from '@radix-ui/themes';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import * as styles from '../../../../page.css';
interface ConfigurationChildWrapperProps { interface ConfigurationChildWrapperProps {
children: ReactNode; children: ReactNode;
@@ -8,9 +8,5 @@ interface ConfigurationChildWrapperProps {
export function ConfigurationChildWrapper({ export function ConfigurationChildWrapper({
children, children,
}: ConfigurationChildWrapperProps) { }: ConfigurationChildWrapperProps) {
return ( return <div className={styles.configurationChild}>{children}</div>;
<Flex direction="column" gap="2" align="end" style={{ width: '100%' }}>
{children}
</Flex>
);
} }
@@ -9,17 +9,12 @@ export function Crew() {
<Flex <Flex
align="center" align="center"
gap="4" gap="4"
style={{
width: '100%',
}}
justify="end" justify="end"
style={{
width: 240,
}}
> >
<Slider <Slider min={50} max={100} defaultValue={[100]} style={{ flex: 1 }} />
min={50}
max={100}
defaultValue={[100]}
style={{ flex: 1, maxWidth: 208 }}
/>
<TextField.Root style={{ width: 64 }}> <TextField.Root style={{ width: 64 }}>
<TextField.Input defaultValue={100} /> <TextField.Input defaultValue={100} />
<TextField.Slot>%</TextField.Slot> <TextField.Slot>%</TextField.Slot>
@@ -1,4 +1,5 @@
import { Flex, Heading } from '@radix-ui/themes'; import { Flex, Heading } from '@radix-ui/themes';
import * as styles from '../../../page.css';
import { Camouflage } from './components/Camouflage'; import { Camouflage } from './components/Camouflage';
import { Consumables } from './components/Consumables'; import { Consumables } from './components/Consumables';
import { Crew } from './components/Crew'; import { Crew } from './components/Crew';
@@ -9,15 +10,8 @@ import { Provisions } from './components/Provisions';
export function Characteristics() { export function Characteristics() {
return ( return (
<Flex gap="4" direction="column"> <Flex className={styles.characteristics}>
<Flex gap="8"> <div className={styles.configuration}>
<Flex
style={{ flex: 1 }}
wrap="wrap"
direction="column"
gap="4"
align="end"
>
<Heading>Configure</Heading> <Heading>Configure</Heading>
<Modules /> <Modules />
@@ -26,7 +20,7 @@ export function Characteristics() {
<Consumables /> <Consumables />
<Provisions /> <Provisions />
<Camouflage /> <Camouflage />
</Flex> </div>
<Flex style={{ flex: 1 }} wrap="wrap" direction="column" gap="4"> <Flex style={{ flex: 1 }} wrap="wrap" direction="column" gap="4">
<Heading>Statistics</Heading> <Heading>Statistics</Heading>
@@ -46,12 +40,7 @@ export function Characteristics() {
<Info indent name="At 500m" value="240" unit="mm" /> <Info indent name="At 500m" value="240" unit="mm" />
<Info name="Damage per minute" value="2316" unit="hp / min" /> <Info name="Damage per minute" value="2316" unit="hp / min" />
<Info indent name="Maximum" value="2316" unit="hp / min" /> <Info indent name="Maximum" value="2316" unit="hp / min" />
<Info <Info indent name="Effective at 60s" value="2316" unit="hp / min" />
indent
name="Effective at 60s"
value="2316"
unit="hp / min"
/>
<Info name="Reload" value="5.73" unit="s" /> <Info name="Reload" value="5.73" unit="s" />
<Info name="Shell velocity" value="1535" unit="m/s" /> <Info name="Shell velocity" value="1535" unit="m/s" />
<Info name="Aim time" value="1.72" unit="s" /> <Info name="Aim time" value="1.72" unit="s" />
@@ -79,12 +68,7 @@ export function Characteristics() {
value="36.86" value="36.86"
unit="hp/kg" unit="hp/kg"
/> />
<Info <Info indent name="On medium terrain" value="36.86" unit="hp/kg" />
indent
name="On medium terrain"
value="36.86"
unit="hp/kg"
/>
<Info indent name="On soft terrain" value="36.86" unit="hp/kg" /> <Info indent name="On soft terrain" value="36.86" unit="hp/kg" />
<Info <Info
name="Traverse speed on hard terrain" name="Traverse speed on hard terrain"
@@ -112,6 +96,5 @@ export function Characteristics() {
</Flex> </Flex>
</Flex> </Flex>
</Flex> </Flex>
</Flex>
); );
} }
+30 -11
View File
@@ -56,19 +56,38 @@ export const alignTopRight = style({
}, },
}); });
export const configure = style({ export const characteristics = style({
display: 'grid', display: 'flex',
gridTemplateColumns: '1fr 1fr', gap: 32,
gap: 16,
'@media': {
'screen and (max-width: 800px)': {
flexDirection: 'column',
},
},
}); });
export const configureRight = style({ export const configurationChild = style({
display: 'flex',
gap: 8,
flexDirection: 'column',
'@media': {
'screen and (min-width: 801px)': {
alignItems: 'end',
},
},
});
export const configuration = style({
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
gap: 8, gap: 16,
}); flex: 1,
export const configureLeft = style({
display: 'flex', '@media': {
flexDirection: 'column', 'screen and (min-width: 801px)': {
gap: 8, alignItems: 'end',
},
},
}); });