Skip to content

Commit 99efcc2

Browse files
committed
fix: improve mobile responsiveness for landing page
Resize oversized header logo/nav on phones, fix modal overflow on small screens, use transform-based toast centering, clamp section headings with vw instead of vmax, and hide Get Extension link on mobile.
1 parent dfff514 commit 99efcc2

7 files changed

Lines changed: 57 additions & 24 deletions

File tree

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ <h1 class="header__name">static.md</h1>
2828
<ul class="header__nav">
2929
<li class="header__nav__item"><a class="header__nav__link link" id="nav_home" href="/" data-navigo="" data-i18n="nav.home">Home</a></li>
3030
<li class="header__nav__item"><a class="header__nav__link link" id="nav_contact" href="/contact" data-navigo="" data-i18n="nav.contact">Contact</a></li>
31+
<li class="header__nav__item"><a class="header__nav__link" id="nav_extension" href="https://chromewebstore.google.com/detail/staticshot-screenshot-cap/bbgoenllpdnfljjapjcababahphohncj" target="_blank" rel="noopener"><svg class="chrome-icon" width="18" height="18" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M188.8,255.93A67.2,67.2,0,1,0,256,188.75,67.38,67.38,0,0,0,188.8,255.93Z"/><path d="M476.75,217.79s0,0,0,.05a206.63,206.63,0,0,0-7-28.84h-.11a202.16,202.16,0,0,1,7.07,29h0a203.5,203.5,0,0,0-7.07-29H314.24c19.05,17,31.36,40.17,31.36,67.05a86.55,86.55,0,0,1-12.31,44.73L231,478.45a2.44,2.44,0,0,1,0,.27V479h0v-.26A224,224,0,0,0,256,480c6.84,0,13.61-.39,20.3-1a222.91,222.91,0,0,0,29.78-4.74C405.68,451.52,480,362.4,480,255.94A225.25,225.25,0,0,0,476.75,217.79Z"/><path d="M256,345.5c-33.6,0-61.6-17.91-77.29-44.79L76,123.05l-.14-.24A224,224,0,0,0,207.4,474.55l0-.05,77.69-134.6A84.13,84.13,0,0,1,256,345.5Z"/><path d="M91.29,104.57l77.35,133.25A89.19,89.19,0,0,1,256,166H461.17a246.51,246.51,0,0,0-25.78-43.94l.12.08A245.26,245.26,0,0,1,461.17,166h.17a245.91,245.91,0,0,0-25.66-44,2.63,2.63,0,0,1-.35-.26A223.93,223.93,0,0,0,91.14,104.34l.14.24Z"/></svg> Get Extension</a></li>
3132
<li class="header__nav__item" id="headerApp"><a class="header__nav__link link" id="nav_upload" href="#" data-i18n="nav.upload" @click="toggleModal($event)">Upload</a></li>
3233
</ul>
3334
</header>

src/styles/components/_gallery.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.grid-sizer,
22
.grid-item {
3+
width: 100%;
34
@media(min-width: 500px) {
45
width: 50%;
56
}
@@ -97,17 +98,18 @@ figure.grid-item {
9798
margin: 0 auto;
9899
padding: 20px 30px;
99100
border: 1px solid #888;
100-
width: 300px;
101+
width: calc(100vw - 2rem);
102+
max-width: 300px;
101103
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
102104
-webkit-animation-name: animateTop;
103105
-webkit-animation-duration: 0.4s;
104106
animation-name: animateTop;
105107
animation-duration: 0.4s;
106108
@media (min-width: 425px) {
107-
width: 400px;
109+
max-width: 400px;
108110
}
109111
@media (min-width: 768px) {
110-
width: 600px;
112+
max-width: 600px;
111113
}
112114
}
113115
/* The Close Button */
@@ -181,9 +183,8 @@ figure.grid-item {
181183
}
182184
.copy-trigger {
183185
position: absolute;
184-
right: 0;
185-
margin-right: 10px;
186-
margin-top: 110px;
186+
right: 1rem;
187+
bottom: 1rem;
187188
color: $primary-color;
188189
&:hover {
189190
cursor: pointer;
@@ -341,7 +342,7 @@ section.headline {
341342
#toast {
342343
visibility: hidden;
343344
min-width: 250px;
344-
margin-left: -125px;
345+
max-width: calc(100vw - 2rem);
345346
background-color: $secondary-color;
346347
color: #fff;
347348
text-align: center;
@@ -352,6 +353,7 @@ section.headline {
352353
left: 50%;
353354
bottom: 30px;
354355
font-size: 17px;
356+
transform: translateX(-50%);
355357
&.show {
356358
visibility: visible;
357359
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;

src/styles/components/_upload_app.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717

1818
.modal-container {
19-
width: 300px;
19+
width: calc(100vw - 2rem);
20+
max-width: 300px;
2021
margin: 0px auto;
2122
padding: 20px 30px;
2223
background-color: #fff;
@@ -25,10 +26,10 @@
2526
transition: all .3s ease;
2627
font-family: Helvetica, Arial, sans-serif;
2728
@media (min-width: 425px) {
28-
width: 400px;
29+
max-width: 400px;
2930
}
3031
@media (min-width: 768px) {
31-
width: 600px;
32+
max-width: 600px;
3233
}
3334
}
3435

@@ -77,11 +78,14 @@
7778
}
7879

7980
.modal-header.modal-title {
80-
padding: 0 50px 20px 0;
81+
padding: 0 20px 20px 0;
8182
border-bottom: 1px solid $active;
8283
color: $active;
8384
font-size: $text-big;
8485
line-height: $line-height-big;
86+
@media (min-width: 425px) {
87+
padding: 0 50px 20px 0;
88+
}
8589
}
8690

8791
input[type="file"] {

src/styles/layout/_footer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
margin-left: 2em;
3535
}
3636
@include mob-small {
37-
flex-basis: 50%;
37+
flex-basis: auto;
3838
&:not(:first-of-type) {
3939
margin-left: 0;
4040
}

src/styles/layout/_header.scss

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
overflow: hidden;
5757
transition: transform .2s ease-in-out;
5858
@include mob-big {
59-
width: 33vw;
60-
height: 33vw;
61-
margin-right: 5vw;
59+
width: 3rem;
60+
height: 3rem;
61+
margin-right: 0.75rem;
6262
}
6363
&:hover {
6464
transform: scale(1.25); // @supports (mix-blend-mode: multiply) {
@@ -94,7 +94,7 @@
9494
display: inline-block;
9595
font-size: $text-normal;
9696
@include mob-big {
97-
font-size: 8vw;
97+
font-size: 1.2em;
9898
}
9999
}
100100

@@ -108,27 +108,53 @@
108108
.header__nav__item {
109109
display: inline-block;
110110
@include mob-big {
111-
margin-bottom: 1em;
112-
font-size: 5vw;
113-
flex-basis: calc(50% - 2em);
114-
&:last-of-type {
115-
flex-basis: 50%;
116-
}
111+
font-size: $text-small;
112+
flex-basis: auto;
113+
text-align: center;
117114
}
118115
&:not(:last-of-type) {
119116
margin-right: 2em;
117+
@include mob-big {
118+
margin-right: 1em;
119+
}
120120
}
121121
}
122122

123123
.header__nav__link {
124124
display: inline-block;
125125
color: $grey-dark;
126126
font-size: $text-normal;
127+
@include mob-big {
128+
min-height: 44px;
129+
line-height: 44px;
130+
}
127131
&--active {
128132
color: $active;
129133
font-weight: $font-bold;
130134
}
131135
&::after {
132136
display: none;
133137
}
138+
}
139+
140+
#nav_extension {
141+
display: inline-flex;
142+
align-items: center;
143+
gap: .35em;
144+
color: $grey-dark;
145+
font-size: $text-normal;
146+
transition: color .2s ease-in-out;
147+
@include mob-big {
148+
display: none;
149+
}
150+
151+
&:hover {
152+
color: $active;
153+
}
154+
155+
.chrome-icon {
156+
flex-shrink: 0;
157+
width: 1em;
158+
height: 1em;
159+
}
134160
}

src/styles/layout/_headline.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
transform: translateZ(0);
77
@include ipad-land {
88
margin: 2rem auto 4rem;
9-
margin: 4vmax auto 8vmax;
9+
margin: 4vw auto 8vw;
1010
}
1111
}
1212

src/styles/layout/_section.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
@include mob-big {
3535
padding: 0 0 2vmax 0;
36-
font-size: 5vmax;
36+
font-size: clamp(1.2em, 5vw, 1.8em);
3737
flex-basis: 100%;
3838
}
3939
}

0 commit comments

Comments
 (0)