Skip to content

Commit

Permalink
Mobile tweaks (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
mojowen authored Dec 18, 2023
1 parent 633e499 commit 5ded037
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/components/app-root/app-root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
img {
width: 30px;
margin-right: 8px;
@media (min-width: 300px) {
@media (min-width: 370px) {
width: 48px;
margin-right: 16px;
}
Expand All @@ -129,14 +129,18 @@
}
li {
display: inline-block;
font-size: 12px;
font-size: 0.65rem;
font-weight: 600;
margin: 0 0.3rem;
position: relative;
color: $white;
height: 1rem;

@media (min-width: 300px) {
font-size: 0.9rem;
margin: 0 0.4rem;
}
@media (min-width: 370px) {
font-size: 1rem;
margin: 0 0.4rem;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/app-root/css/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ html {
text-rendering: optimizeLegibility;
text-size-adjust: 100%;
scroll-behavior: smooth;
min-width: 240px;
}

body {
Expand Down
19 changes: 15 additions & 4 deletions src/components/page-home/page-home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ page-home {
padding: 40px 0;
}

.button + .button {
margin-left: 1rem;
@media (max-width: 300px) {
margin: 1rem 0 0;
.button {
& + .button {
margin-left: 1rem;
}
@media (max-width: 380px) {
& + .button {
margin: 1rem 0 0;
}
display: block;
}
}

Expand Down Expand Up @@ -99,6 +104,12 @@ page-home {

.order-pizzas {
background-color: $light-red;
label {
height: 4rem;
margin: -20px 0;
padding: 20px 0;
cursor: text;
}
ui-location-search div {
position: relative;
input {
Expand Down
11 changes: 8 additions & 3 deletions src/components/page-home/page-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ export class PageHome {
</div>
</div>
<section class="order-pizzas">
<div class="container">
<ui-location-search placeholder="Stuck in a long line? Search your location here" onLocationSelected={handleLocationSelected} />
</div>
<label htmlFor="autocomplete-input">
<div class="container">
<ui-location-search
placeholder={(window?.document?.body?.clientWidth || 0) < 400 ? "Stuck in line? Search here" : "Stuck in a long line? Search your location here"}
onLocationSelected={handleLocationSelected}
/>
</div>
</label>
</section>
<section class="totals">{this.totals && <Stats totals={this.totals} />}</section>
<section class="tweets-deliveries">
Expand Down
14 changes: 14 additions & 0 deletions src/components/ui-single-input/ui-single-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,18 @@ ui-single-input {
margin: 0;
border-radius: 0 $radius $radius 0;
}

@media (max-width: 400px) {
.submit-button,
.input-value {
float: none;
display: block;
border-radius: $radius;
margin: 0 auto;
}
.input-value {
width: 100%;
margin-bottom: 0.5rem;
}
}
}

0 comments on commit 5ded037

Please sign in to comment.