Skip to content

Commit 3898b06

Browse files
committed
Responsive Design
1 parent df36601 commit 3898b06

15 files changed

+338
-57
lines changed

Project-Trillio/css/style.css

+151-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
html {
2626
box-sizing: border-box;
2727
font-size: 62.5%; }
28+
@media only screen and (max-width: 68.75em) {
29+
html {
30+
font-size: 50%; } }
2831

2932
body {
3033
font-family: 'Open Sans', sans-serif;
@@ -42,6 +45,11 @@ body {
4245
background-color: var(--color-grey-light-2);
4346
box-shadow: var(--shadow-dark);
4447
min-height: 50rem; }
48+
@media only screen and (max-width: 75em) {
49+
.container {
50+
margin: 0;
51+
max-width: 100%;
52+
width: 100%; } }
4553

4654
.header {
4755
font-size: 1.4rem;
@@ -51,9 +59,17 @@ body {
5159
display: flex;
5260
justify-content: space-between;
5361
align-items: center; }
62+
@media only screen and (max-width: 31.25rem) {
63+
.header {
64+
flex-wrap: wrap;
65+
height: 12rem;
66+
align-content: space-around; } }
5467

5568
.content {
5669
display: flex; }
70+
@media only screen and (max-width: 56.25em) {
71+
.content {
72+
flex-direction: column; } }
5773

5874
.sidebar {
5975
background-color: var(--color-grey-dark-1);
@@ -72,6 +88,12 @@ body {
7288
padding: 4.5rem;
7389
background-color: var(--color-grey-light-1);
7490
border-bottom: var(--line); }
91+
@media only screen and (max-width: 56.25em) {
92+
.detail {
93+
padding: 3rem; } }
94+
@media only screen and (max-width: 37.5em) {
95+
.detail {
96+
flex-direction: column; } }
7597

7698
.description {
7799
font-size: 1.4rem;
@@ -80,9 +102,20 @@ body {
80102
padding: 3rem;
81103
flex: 0 0 60%;
82104
margin-right: 4.5rem; }
105+
@media only screen and (max-width: 56.25em) {
106+
.description {
107+
padding: 2rem;
108+
margin-right: 3rem; } }
109+
@media only screen and (max-width: 37.5em) {
110+
.description {
111+
margin-right: 0;
112+
margin-bottom: 3rem; } }
83113

84114
.user-reviews {
85-
flex: 1; }
115+
flex: 1;
116+
display: flex;
117+
flex-direction: column;
118+
align-items: center; }
86119

87120
.logo {
88121
height: 3.25rem;
@@ -94,6 +127,11 @@ body {
94127
align-items: center;
95128
justify-content: center;
96129
padding: 0 0.2rem; }
130+
@media only screen and (max-width: 31.25rem) {
131+
.search {
132+
order: 1;
133+
flex: 0 0 100%;
134+
background-color: var(--color-grey-light-2); } }
97135
.search__input {
98136
font-family: inherit;
99137
font-size: inherit;
@@ -166,10 +204,20 @@ body {
166204
font-size: 1.4rem;
167205
list-style: none;
168206
margin-top: 3.5rem; }
207+
@media only screen and (max-width: 56.25em) {
208+
.side-nav {
209+
display: flex;
210+
margin: 0; } }
169211
.side-nav__item {
170212
position: relative; }
171213
.side-nav__item:not(:last-child) {
172214
margin-bottom: 0.5rem; }
215+
@media only screen and (max-width: 56.25em) {
216+
.side-nav__item:not(:last-child) {
217+
margin: 0; } }
218+
@media only screen and (max-width: 56.25em) {
219+
.side-nav__item {
220+
flex: 1; } }
173221
.side-nav__item::before {
174222
content: "";
175223
position: absolute;
@@ -195,6 +243,14 @@ body {
195243
align-items: center;
196244
position: relative;
197245
z-index: 10; }
246+
@media only screen and (max-width: 56.25em) {
247+
.side-nav__link:link, .side-nav__link:visited {
248+
justify-content: center;
249+
padding: 2rem; } }
250+
@media only screen and (max-width: 37.5em) {
251+
.side-nav__link:link, .side-nav__link:visited {
252+
flex-direction: column;
253+
padding: 1.5rem 0.5rem; } }
198254
.side-nav__link:hover {
199255
color: #fff;
200256
cursor: pointer; }
@@ -204,11 +260,20 @@ body {
204260
height: 1.75rem;
205261
margin-right: 2rem;
206262
fill: white; }
263+
@media only screen and (max-width: 37.5em) {
264+
.side-nav__icon {
265+
margin-right: 0;
266+
margin-bottom: 7px;
267+
width: 1.5rem;
268+
height: 1.5rem; } }
207269
.side-nav .legal {
208270
font-size: 1.2rem;
209271
text-align: center;
210272
padding: 2.5rem;
211273
color: var(--color-grey-light-4); }
274+
@media only screen and (max-width: 56.25em) {
275+
.side-nav .legal {
276+
display: none; } }
212277

213278
.legal {
214279
font-size: 1.2rem;
@@ -232,6 +297,10 @@ body {
232297
text-transform: uppercase;
233298
letter-spacing: 1px;
234299
padding: 1.5rem 3rem; }
300+
@media only screen and (max-width: 37.5em) {
301+
.overview__heading {
302+
font-size: 1.8rem;
303+
padding: 1.25rem 2rem; } }
235304
.overview__stars {
236305
margin-right: auto;
237306
display: flex; }
@@ -254,13 +323,22 @@ body {
254323
flex-direction: column;
255324
justify-content: center;
256325
align-items: center; }
326+
@media only screen and (max-width: 37.5em) {
327+
.overview__rating {
328+
padding: 0 1.5rem; } }
257329
.overview__rating-average {
258330
font-size: 2.25rem;
259331
font-weight: 300;
260332
margin-bottom: -3px; }
333+
@media only screen and (max-width: 37.5em) {
334+
.overview__rating-average {
335+
font-size: 1.8rem; } }
261336
.overview__rating-count {
262337
font-size: 0.8rem;
263338
text-transform: uppercase; }
339+
@media only screen and (max-width: 37.5em) {
340+
.overview__rating-count {
341+
font-size: 0.5rem; } }
264342

265343
.btn-inline {
266344
border: none;
@@ -272,8 +350,13 @@ body {
272350
background-color: transparent;
273351
cursor: pointer;
274352
transition: all 0.2s; }
353+
.btn-inline span {
354+
margin-left: 3px;
355+
transition: margin-left 0.2s; }
275356
.btn-inline:hover {
276357
color: var(--color-grey-dark-1); }
358+
.btn-inline:hover span {
359+
margin-left: 8px; }
277360
.btn-inline:focus {
278361
outline: none;
279362
animation: pulsate 1s infinite; }
@@ -324,22 +407,32 @@ body {
324407
align-items: center; }
325408
.recommended__count {
326409
margin-right: auto; }
410+
.recommended__friends {
411+
display: flex; }
327412
.recommended__photo {
328413
box-sizing: content-box;
329414
height: 4rem;
330415
width: 4rem;
331416
border-radius: 50%;
332417
border: 3px solid #fff; }
333418
.recommended__photo:not(:last-child) {
334-
margin-right: -1.5rem; }
419+
margin-right: -2rem; }
335420

336421
.review {
337422
background-color: #fff;
338423
box-shadow: var(--shadow-light);
339424
padding: 3rem;
340-
margin-bottom: 3.5rem; }
425+
margin-bottom: 3.5rem;
426+
position: relative;
427+
overflow: hidden; }
428+
@media only screen and (max-width: 56.25em) {
429+
.review {
430+
margin-bottom: 3rem;
431+
padding: 2rem; } }
341432
.review__text {
342-
margin-bottom: 2rem; }
433+
margin-bottom: 2rem;
434+
z-index: 10;
435+
position: relative; }
343436
.review__user {
344437
display: flex;
345438
align-items: center; }
@@ -363,4 +456,57 @@ body {
363456
font-size: 2.2rem;
364457
font-weight: 300; }
365458
.review::before {
366-
content: ""; }
459+
content: "\201C";
460+
position: absolute;
461+
top: -2rem;
462+
left: -1rem;
463+
font-size: 20rem;
464+
color: var(--color-grey-light-2);
465+
font-family: sans-serif;
466+
line-height: 1;
467+
z-index: 1; }
468+
469+
.cta {
470+
padding: 3.5rem 0;
471+
text-align: center; }
472+
@media only screen and (max-width: 56.25em) {
473+
.cta {
474+
padding: 2.5rem 0; } }
475+
.cta__book-now {
476+
font-size: 2rem;
477+
font-weight: 300;
478+
text-transform: uppercase;
479+
margin-bottom: 1.5rem; }
480+
481+
.btn {
482+
font-size: 1.5rem;
483+
border: none;
484+
font-weight: 300;
485+
text-transform: uppercase;
486+
border-radius: 100px;
487+
background-image: linear-gradient(to right bottom, var(--color-primary-light), var(--color-primary-dark));
488+
color: #fff;
489+
position: relative;
490+
overflow: hidden;
491+
cursor: pointer; }
492+
.btn > * {
493+
height: 100%;
494+
width: 100%;
495+
display: inline-block;
496+
transition: all 0.2s; }
497+
.btn__visible {
498+
padding: 2rem 7.5rem; }
499+
.btn__invisible {
500+
position: absolute;
501+
padding: 2rem 0rem;
502+
left: 0;
503+
top: -100%; }
504+
.btn:hover {
505+
background-image: linear-gradient(to right bottom, var(--color-primary-light), var(--color-primary-dark)); }
506+
.btn:hover .btn__visible {
507+
transform: translateY(100%); }
508+
.btn:hover .btn__invisible {
509+
top: 0; }
510+
.btn:focus {
511+
outline: none;
512+
animation: pulsate 1s infinite; }

Project-Trillio/images/SVG/aircraft-take-off.svg

-5
This file was deleted.

Project-Trillio/images/SVG/bookmark.svg

-5
This file was deleted.

Project-Trillio/images/SVG/chat.svg

-5
This file was deleted.

Project-Trillio/images/SVG/chevron-thin-right.svg

-5
This file was deleted.

Project-Trillio/images/SVG/home.svg

-5
This file was deleted.

Project-Trillio/images/SVG/key.svg

-5
This file was deleted.

Project-Trillio/images/SVG/location-pin.svg

-5
This file was deleted.

Project-Trillio/images/SVG/magnifying-glass.svg

-5
This file was deleted.

Project-Trillio/images/SVG/map.svg

-5
This file was deleted.

Project-Trillio/images/SVG/star.svg

-5
This file was deleted.

Project-Trillio/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,18 @@ <h1 class="overview__heading">
160160
<div class="review__rating">9.3</div>
161161
</figcaption>
162162
</figure>
163+
<button class="btn-inline">Show all <span>&rarr;</span></button>
163164
</div>
164165
</div>
166+
<div class="cta">
167+
<h2 class="cta__book-now">
168+
Good News! We have 4 free rooms for your elected dates!
169+
</h2>
170+
<button class="btn">
171+
<span class="btn__visible">Book Now</span>
172+
<span class="btn__invisible">Only 4 rooms left!</span>
173+
</button>
174+
</div>
165175
</main>
166176
</div>
167177
</div>

Project-Trillio/sass/_base.scss

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
--line: 1px solid var(var(--color-grey-light-2));
1414
--shadow-light: 0 2rem 5rem rgba(0, 0, 0, 0.06);
1515
}
16+
17+
$bp-largest: 75em; // (1200px/16 = 75em)
18+
$bp-large: 68.75em; // (1100px/16 = 68.75em)
19+
$bp-medium: 56.25em; //(900px/16 = 56.25em)
20+
$bp-small: 37.5em; // (600px/16 = 37.5em)
21+
$bp-smallest: 31.25rem; // (500px/16 = 31.25rem);
22+
1623
* {
1724
margin: 0;
1825
padding: 0;
@@ -25,6 +32,9 @@
2532
html {
2633
box-sizing: border-box;
2734
font-size: 62.5%; // 1 rem = 10px, 10px/16px = 62.5%
35+
@media only screen and (max-width: $bp-large) {
36+
font-size: 50%;
37+
}
2838
}
2939
body {
3040
font-family: 'Open Sans', sans-serif;

0 commit comments

Comments
 (0)