Skip to content

Commit 73015c1

Browse files
committed
Add the Call to Action section.
1 parent c833b05 commit 73015c1

File tree

3 files changed

+170
-1
lines changed

3 files changed

+170
-1
lines changed

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ Paragraph default: 1.6
2727
- Tints:
2828
#fdf2e9
2929
#fae5d3
30+
#eb984e
3031
3132
- Shades:
3233
#cf711f
34+
#45260a
35+
3336
- Accents:
3437
- Greys:
3538
#6f6f6f (lightest grey allowed on #6f6f6f)
@@ -152,16 +155,22 @@ body {
152155
letter-spacing: 0.75px;
153156
}
154157

158+
.btn,
155159
.btn:link,
156160
.btn:visited {
157161
display: inline-block;
158-
background-color: #e67e22;
162+
159163
text-decoration: none;
160164
font-size: 2rem;
161165
font-weight: 600;
162166
padding: 1.6rem 3.2rem;
163167
border-radius: 9px;
164168

169+
/* Only necessary for .btn */
170+
border: none;
171+
cursor: pointer;
172+
font-family: inherit;
173+
165174
/* Put transition on original "state" */
166175
/* transition: background-color 0.3s; */
167176
transition: all 0.3s;
@@ -193,6 +202,17 @@ body {
193202
/* Trick to add border inside */
194203
box-shadow: inset 0 0 0 3px #fff;
195204
}
205+
.btn--form {
206+
background-color: #45260a;
207+
color: #fdf2e9;
208+
align-self: end;
209+
padding: 1.2rem;
210+
}
211+
212+
.btn--form:hover {
213+
background-color: #fff;
214+
color: #555;
215+
}
196216

197217
.link:link,
198218
.link:visited {
@@ -230,6 +250,13 @@ body {
230250
color: #e67e22;
231251
}
232252

253+
*:focus {
254+
outline: none;
255+
/* outline: 4px dotted #e67e22;
256+
outline-offset: 8px; */
257+
box-shadow: 0 0 0 0.8rem rgba(230, 125, 34, 0.5);
258+
}
259+
233260
/* HELPER/SETTINGS CLASSES */
234261
.margin-right-sm {
235262
margin-right: 1.6rem !important;

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

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

starter/07-Omnifood-Desktop/content/index.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,66 @@ <h2 class="heading-secondary">
535535
</div>
536536
</div>
537537
</section>
538+
539+
<!-- CALL TO ACTIONS -->
540+
<section class="section-cta">
541+
<div class="container">
542+
<div class="cta">
543+
<div class="cta-text-box">
544+
<h2 class="heading-secondary">Get your first meal for free</h2>
545+
<p class="cta-text">
546+
Healthy, tasty and hassle-free meals are waiting for you. Start
547+
eating well today. You can cancel or pause anytime. And the
548+
first meal is on us!
549+
</p>
550+
551+
<form action="#" class="cta-form">
552+
<div>
553+
<label for="full-name">Full Name</label>
554+
<input
555+
id="full-name"
556+
type="text"
557+
placeholder="John Smith"
558+
required
559+
/>
560+
</div>
561+
562+
<div>
563+
<label for="email">Email Address</label>
564+
<input
565+
id="email"
566+
type="email"
567+
placeholder="me@example.com"
568+
required
569+
/>
570+
</div>
571+
572+
<div>
573+
<label for="select-where">Where did you hear from us?</label>
574+
<select name="" id="select-where" required>
575+
<option value="">Please choose one option:</option>
576+
<option value="friends">Friend and family</option>
577+
<option value="youtube">Youtube video</option>
578+
<option value="podcast">Podcast</option>
579+
<option value="facebook">Facebook</option>
580+
<option value="others">Others</option>
581+
</select>
582+
</div>
583+
584+
<button class="btn btn--form">Sign up now</button>
585+
586+
<!-- <input type="checkbox" />
587+
<input type="number" /> -->
588+
</form>
589+
</div>
590+
<div
591+
class="cta-img-box"
592+
role="img"
593+
aria-label="Woman enjoying food"
594+
></div>
595+
</div>
596+
</div>
597+
</section>
538598
</main>
539599
</body>
540600
</html>

0 commit comments

Comments
 (0)