Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MZ spacing problems #191

Merged
merged 11 commits into from
Sep 22, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Changed

- Layout and spacing in the Mission Zero Control Panel so web component fits in a narrower container (#191)
- Updated modal styling (#193)

## [0.4.0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ const AstroPiControls = (props) => {
<div className='sense-hat-controls'>
<h2 className='sense-hat-controls-heading'>Space Station Control Panel</h2>
<div className="sense-hat-controls-panel">
<div className='sense-hat-controls-panel__sliders'>
<SliderInput name="temperature" unit="°C" min={-40} max={120} defaultValue={temperature} Icon={TemperatureIcon} />
<SliderInput name="pressure" unit="hPa" min={260} max={1260} defaultValue={pressure} Icon={PressureIcon}/>
<SliderInput name="humidity" unit="%" min={0} max={100} defaultValue={humidity} Icon={HumidityIcon}/>
</div>

<div className="sense-hat-controls-panel__control">
<Input name="colour" label="Colour Picker" type="color" defaultValue={colour} />
<div className="sense-hat-controls-panel__control sense-hat-controls-panel__control-last">
<Input name="colour" label="Colour" type="color" defaultValue={colour} />
<MotionInput defaultValue={motion} />
<Stopwatch />
</div>
Expand Down
35 changes: 27 additions & 8 deletions src/components/AstroPiModel/AstroPiModel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
}

&__values {
flex: 8;
flex: 10;
display: flex;
margin: 0 var(--spacing-6);
margin: 0 var(--spacing-1);
}

&__reading {
flex: 1;
text-transform: uppercase;
font-weight: var(--font-weight-bold);
margin: 0 var(--spacing-2);
margin: 0 var(--spacing-1);
font-size: var(--font-size-d-1);
}

Expand Down Expand Up @@ -74,7 +74,7 @@
&-panel {
flex: 1;
display: flex;
justify-content: space-between;
flex-flow: column;

&__control {
display: flex;
Expand All @@ -85,7 +85,7 @@
padding-top: var(--spacing-half);
box-sizing: border-box;
border-radius: 5px;
width: 24%;
width: 32%;
justify-content: space-between;

&-reading {
Expand All @@ -110,7 +110,7 @@
&-toggle {
border-radius: 5px;
width: 100%;
padding: var(--spacing-half);
flex: 1;
box-sizing: border-box;
display: flex;
align-items: center;
Expand All @@ -123,12 +123,15 @@

&-input {
cursor: pointer;
width: 115px;
width: 85px;
transform: rotate(270deg);
}

input[type='color'] {
border-radius: 5px;
flex: 1;
width: 100%;
padding: var(--spacing-half) var(--spacing-2);
}

&-name {
Expand All @@ -140,13 +143,29 @@
&-value {
margin-left: var(--spacing-half);
}

&-last {
margin-top: var(--spacing-1);
flex-flow: row;
width: 100%;
align-items: inherit;
justify-content: space-between;
}
}

&__sliders {
display: flex;
justify-content: space-between;
.sense-hat-controls-panel__control {
min-height: 175px;
}
}

&__container {
display: flex;
flex-flow: column;
align-items: center;
width: 100%;
width: 32%;

.sense-hat-controls-panel__control-name, input {
cursor: pointer;
Expand Down