Skip to content

Commit e0ecaf7

Browse files
committed
section-7: Form.
1 parent c6c4f0f commit e0ecaf7

File tree

3 files changed

+138
-2
lines changed

3 files changed

+138
-2
lines changed

starter/07-Omnifood-Desktop/css/general.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ SPACING SYSTEM (px)
4646
margin: 0;
4747
}
4848

49+
*:focus {
50+
box-shadow: 0 0 0 0.8rem rgba(230, 125, 34, 0.5);
51+
outline: none;
52+
}
53+
4954
html {
5055
font-size: 62.5%;
5156
}
@@ -61,16 +66,30 @@ strong {
6166
font-weight: 500;
6267
}
6368

64-
.btn:link, .btn:visited {
69+
.btn, .btn:link, .btn:visited {
70+
border: none;
6571
border-radius: .9rem;
6672
color: #fff;
73+
cursor: pointer;
6774
display: inline-block;
6875
font-size: 2rem;
6976
padding: 1.6rem 3.2rem;
7077
text-decoration: none;
7178
transition: all 300ms;
7279
}
7380

81+
.btn--form {
82+
align-self: end;
83+
background-color: #45260a;
84+
color: #fdf2e9;
85+
padding: 1.2rem;
86+
}
87+
88+
.btn--form:hover {
89+
background-color: #fff;
90+
color: #555;
91+
}
92+
7493
.btn--full:link, .btn--full:visited {
7594
background-color: #e67e22;
7695
color: #fff;

starter/07-Omnifood-Desktop/css/style.css

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,77 @@
440440
font-weight: 700;
441441
margin-bottom: 1.6rem;
442442
}
443+
444+
445+
/*** CTA ***/
446+
447+
.cta {
448+
background-image: linear-gradient(to right bottom, #eb984e, #e67e22);
449+
border-radius: 1.1rem;
450+
box-shadow: 0 2.4rem 4.8rem rgba(0, 0, 0, 0.15);
451+
display: grid;
452+
grid-template-columns: 2fr 1fr;
453+
overflow: hidden;
454+
}
455+
456+
.cta *:focus {
457+
box-shadow: 0 0 0 0.8rem rgba(253, 242, 233, 0.5);
458+
outline: none;
459+
}
460+
461+
.cta-form {
462+
column-gap: 3.2rem;
463+
display: grid;
464+
grid-template-columns: 1fr 1fr;
465+
row-gap: 2.4rem;
466+
}
467+
468+
.cta-form input, .cta-form select {
469+
background-color: #fdf2e9;
470+
border: none;
471+
border-radius: 0.9rem;
472+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
473+
color: inherit;
474+
font-family: inherit;
475+
font-size: 1.8rem;
476+
padding: 1.2rem;
477+
width: 100%;
478+
}
479+
480+
.cta-form input::placeholder {
481+
color: #aaa;
482+
}
483+
484+
.cta-form label {
485+
display: block;
486+
font-size: 1.6rem;
487+
font-weight: 500;
488+
margin-bottom: 1.2rem;
489+
}
490+
491+
.cta .heading-secondary {
492+
color: #45260a;
493+
margin-bottom: 3.2rem;
494+
}
495+
496+
.cta-img-box {
497+
background-image: linear-gradient(to right bottom, rgba(235, 151, 78, 0.35), rgba(230, 125, 34, 0.35)),
498+
url("../img/eating.jpg");
499+
background-position: center;
500+
background-size: cover;
501+
}
502+
503+
.cta-text {
504+
font-size: 1.8rem;
505+
line-height: 1.8;
506+
margin-bottom: 4.8rem;
507+
}
508+
509+
.cta-text-box {
510+
color: #45260a;
511+
padding: 4.8rem 6.4rem 6.4rem 6.4rem;
512+
}
513+
514+
.section-cta {
515+
padding: 9.6rem 0;
516+
}

starter/07-Omnifood-Desktop/index.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ <h2 class="heading-secondary">
411411
</div>
412412

413413
<!-- FEATURES -->
414-
415414
<div class="container grid grid--4-cols">
416415
<div class="feature">
417416
<ion-icon class="feature-icon" name="infinite-outline"></ion-icon>
@@ -454,6 +453,50 @@ <h2 class="heading-secondary">
454453
</div>
455454
</div>
456455
</section>
456+
457+
458+
<!-- CTA -->
459+
<section class="section-cta">
460+
<div class="container">
461+
<div class="cta">
462+
<div class="cta-text-box">
463+
<h2 class="heading-secondary">
464+
Get your first meal for free!
465+
</h2>
466+
<p class="cta-text">
467+
Healthy, tasty and hassle-free meals are waiting for you. Start eating well today. You can cancel or pause anytime. And the first meal is on us!
468+
</p>
469+
470+
<form action="#" class="cta-form">
471+
<div>
472+
<label for="full-name">Full name</label>
473+
<input type="text" placeholder="John Smith" id="full-name" required />
474+
</div>
475+
476+
<div>
477+
<label for="email">Email address</label>
478+
<input type="email" id="email" required />
479+
</div>
480+
481+
<div>
482+
<label for="select-where">Where did you hear from us?</label>
483+
<select id="select-where" required>
484+
<option value="">Please choose one option</option>
485+
<option value="friends">Friends and family</option>
486+
<option value="youtube">YouTube video</option>
487+
<option value="podcast">Podcast</option>
488+
<option value="ad">Facebook ad</option>
489+
<option value="others">Others</option>
490+
</select>
491+
</div>
492+
493+
<button class="btn btn--form">Sign up now</button>
494+
</form>
495+
</div>
496+
<div class="cta-img-box" role="img" aria-label="Woman enjoying food."></div>
497+
</div>
498+
</div>
499+
</section>
457500
</main>
458501
</body>
459502
</html>

0 commit comments

Comments
 (0)