Skip to content

Commit 29b9068

Browse files
committed
feat: building the call-to-action section
1 parent bf3bb79 commit 29b9068

File tree

3 files changed

+169
-2
lines changed

3 files changed

+169
-2
lines changed

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

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ Paragraph default: 1.6
2323
--- 02 COLORS
2424
2525
- Primary: #e67e22
26-
- Tints: #fdf2e9
27-
- Shades: #fae5d3
26+
- Tints:
27+
#fdf2e9
28+
#fae5d3
29+
#eb984e
30+
31+
- Shades:
32+
#cf711f
33+
#45260a
34+
2835
- Accents:
2936
- Greys
3037
#6f6f6f (lightest grey allowed on #fdf2e9)
@@ -33,6 +40,8 @@ Paragraph default: 1.6
3340
3441
--- 03 SHADOWS
3542
43+
0 2.4rem 4.8rem rgba(0, 0, 0, 0.075);
44+
3645
--- 04 BORDER-RADIUS
3746
Default 9px
3847
Medium 11px
@@ -133,6 +142,7 @@ body {
133142
letter-spacing: 0.75px;
134143
}
135144

145+
.btn,
136146
.btn:link,
137147
.btn:visited {
138148
display: inline-block;
@@ -142,6 +152,10 @@ body {
142152
padding: 1.6rem 2.3rem;
143153
border-radius: 9px;
144154

155+
border: none;
156+
cursor: pointer;
157+
font-family: inherit;
158+
145159
transition: all 0.3s;
146160
}
147161

@@ -168,6 +182,18 @@ body {
168182
box-shadow: inset 0 0 0 3px #fff;
169183
}
170184

185+
.btn--form {
186+
background-color: #45260a;
187+
color: #fdf2e9;
188+
padding: 1.2rem;
189+
align-self: end;
190+
}
191+
192+
.btn--form:hover {
193+
background-color: #fff;
194+
color: #555;
195+
}
196+
171197
.link:link,
172198
.link:visited {
173199
display: inline-block;
@@ -203,6 +229,11 @@ body {
203229
color: #e67e22;
204230
}
205231

232+
*:focus {
233+
outline: none;
234+
box-shadow: 0 0 0 0.8rem rgb(230, 126, 34, 0.5);
235+
}
236+
206237
.margin-right-sm {
207238
margin-right: 1.6rem !important;
208239
}

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

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,3 +467,85 @@
467467
font-size: 1.8rem;
468468
line-height: 1.8rem;
469469
}
470+
471+
/*************************************/
472+
/* CTA SECTION */
473+
/*************************************/
474+
475+
.section-cta {
476+
padding: 9.6rem 0;
477+
}
478+
479+
.cta {
480+
display: grid;
481+
grid-template-columns: 2fr 1fr;
482+
box-shadow: 0 2.4rem 4.8rem rgba(0, 0, 0, 0.15);
483+
border-radius: 11px;
484+
485+
background-image: linear-gradient(to right bottom, #eb984e, #e67e22);
486+
overflow: hidden;
487+
}
488+
489+
.cta-text-box {
490+
padding: 4.8rem 6.4rem 6.4rem 6.4rem;
491+
color: #45260a;
492+
}
493+
494+
.cta-text {
495+
font-size: 1.8rem;
496+
line-height: 1.8;
497+
margin-bottom: 4.8rem;
498+
}
499+
500+
.cta .heading-secondary {
501+
color: inherit;
502+
margin-bottom: 3.2rem;
503+
}
504+
505+
.cta-img-box {
506+
background-image: linear-gradient(
507+
to right bottom,
508+
rgb(235, 152, 78, 0.35),
509+
rgb(230, 126, 34, 0.35)
510+
),
511+
url("../img/eating.jpg");
512+
background-repeat: no-repeat;
513+
background-size: cover;
514+
background-position: center;
515+
}
516+
517+
.cta-form {
518+
display: grid;
519+
grid-template-columns: 1fr 1fr;
520+
column-gap: 3.2rem;
521+
row-gap: 2.4rem;
522+
}
523+
524+
.cta-form label {
525+
display: block;
526+
font-size: 1.6rem;
527+
font-weight: 500;
528+
margin-bottom: 1.2rem;
529+
}
530+
531+
.cta-form input,
532+
.cta-form select {
533+
width: 100%;
534+
padding: 1.2rem;
535+
font-size: 1.8rem;
536+
font-family: inherit;
537+
color: inherit;
538+
border: none;
539+
background-color: #fdf2e9;
540+
border-radius: 9px;
541+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
542+
}
543+
544+
.cta-form input::placeholder {
545+
color: #aaa;
546+
}
547+
548+
.cta *:focus {
549+
outline: none;
550+
box-shadow: 0 0 0 0.8rem rgb(253, 242, 233, 0.5);
551+
}

starter/07-Omnifood-Desktop/index.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,60 @@ <h2 class="heading-secondary">
579579
</div>
580580
</div>
581581
</section>
582+
583+
<section class="section-cta">
584+
<div class="container">
585+
<div class="cta">
586+
<div class="cta-text-box">
587+
<h2 class="heading-secondary">Get your first meal for free!</h2>
588+
<p class="cta-text">
589+
Healthy, tasty and hassle-free meals are waiting for you. Start
590+
eating well today. You can cancel or pause anytime. And the
591+
first meal is on us!
592+
</p>
593+
594+
<form action="#" class="cta-form">
595+
<div>
596+
<label for="fullName">Full Name</label>
597+
<input
598+
type="text"
599+
id="fullName"
600+
placeholder="John Smith"
601+
required
602+
/>
603+
</div>
604+
605+
<div>
606+
<label for="emailAddress">Email address</label>
607+
<input
608+
type="email"
609+
id="emailAddress"
610+
placeholder="me@example.com"
611+
required
612+
/>
613+
</div>
614+
615+
<div>
616+
<label for="selectWhere">Where did you hear from us?</label>
617+
<select name="selectWhere" id="selectWhere" required>
618+
<option value="">Please choose one aption:</option>
619+
<option value="friends">Friends and family</option>
620+
<option value="internet">Internet</option>
621+
<option value="news">News or magazines</option>
622+
</select>
623+
</div>
624+
625+
<button class="btn btn--form">Sign up now</button>
626+
</form>
627+
</div>
628+
<div
629+
class="cta-img-box"
630+
role="img"
631+
aria-label="Woman enjoying food"
632+
></div>
633+
</div>
634+
</div>
635+
</section>
582636
</main>
583637

584638
<script

0 commit comments

Comments
 (0)