Responsive Web Design Projects - Build a Product Landing Page at freecodecamp.com
A Pen by Valentin TT on CodePen.
<script src="https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js | |
"></script> | |
<header id="header"> | |
<!--//TODO: The img is only use to pass the fcc test--> | |
<img src="" id="header-img"> | |
<div class="parallax-top"> | |
<div class="title-container"> | |
<h1>Kindle “A New Way of Reading”</h1> | |
</div> | |
</div> | |
<nav id="nav-bar" role="navigation"> | |
<a class="nav-link" href="#header">Home</a> | |
<a class="nav-link" href="#description-section">Description</a> | |
<a class="nav-link" href="#comparison-section">Comparison</a> | |
<a class="nav-link" href="#pricing-section">Pricing</a> | |
<a class="nav-link" href="#order-section">Order</a> | |
<a class="nav-link" href="#about">About</a> | |
</nav> | |
</header> | |
<main> | |
<section id="description-section"> | |
<div> | |
<h2 class="section-title">A booklover's | |
<strong>new best friend</strong> | |
</h2> | |
<div class="characteristics-container"> | |
<div class="characteristic"> | |
<p class="characteristic-title">Thin and light for one-handed reading</p> | |
<p class="characteristic-body"> | |
<em>New—</em>Kindle is 11% thinner and 16% lighter than the previous generation Kindle, making it easy and comfortable to hold in one hand.</p> | |
</div> | |
<div class="characteristic"> | |
<p class="characteristic-title">No eye strain, reads like real paper</p> | |
<p class="characteristic-body">Kindle uses actual ink particles and proprietary, hand-built fonts to create crisp text similar to what you see in a physical book. The blacks and whites on the screen are uniform, improving text and image quality.</p> | |
</div> | |
<div class="characteristic"> | |
<p class="characteristic-title">Unlike tablets, no blue light to disturb your sleep</p> | |
<p class="characteristic-body">Recent studies have shown that evening exposure to blue light from backlit screens like tablets and smartphones can suppress the body’s production of melatonin, a naturally occurring hormone that helps the body fall asleep. Because the Kindle display | |
emits no light, you can read anytime without losing sleep.</p> | |
</div> | |
<div class="characteristic"> | |
<p class="characteristic-title">No glare in bright sunlight</p> | |
<p class="characteristic-body">Unlike reflective tablet and smartphone screens, the high contrast touchscreen display eliminates glare in any setting—even direct sunlight.</p> | |
</div> | |
<div class="characteristic"> | |
<p class="characteristic-title">Battery lasts weeks, not hours</p> | |
<p class="characteristic-body">A single battery charge allows you to read for weeks, not hours.</p> | |
</div> | |
<div class="characteristic"> | |
<p class="characteristic-title">Millions of books, no distractions</p> | |
<p class="characteristic-body">Kindle is designed as a dedicated e-reader. Indulge your love of reading without interruptions like email alerts and push notifications. | |
</p> | |
</div> | |
</div> | |
<div class="video-container"> | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/iO7rul8rykI" frameborder="0" allowfullscreen id="video"></iframe> | |
</div> | |
</section> | |
<section id="comparison-section"> | |
<p class="section-title"><em>There is a Kindle that adapts just right for you</em></p> | |
<div class="table-container"> | |
<table class="comparison-table"> | |
<thead> | |
<tr> | |
<th>Model</th> | |
<th>Oasis 2</th> | |
<th>Voyage</th> | |
<th>Paperwhite 3</th> | |
<th>Kindle</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td>Wireless</td> | |
<td colspan="3">Wi-Fi, 3G*</td> | |
<td>Wi-Fi</td> | |
</tr> | |
<tr> | |
<td>Screen size</td> | |
<td>7in</td> | |
<td colspan="3">6in</td> | |
</tr> | |
<tr> | |
<td>Built-in light</td> | |
<td colspan="3">Yes</td> | |
<td>No</td> | |
</tr> | |
<tr> | |
<td>Page turns</td> | |
<td colspan="3">300ppi</td> | |
<td>167ppi</td> | |
</tr> | |
<tr> | |
<td>Available colors</td> | |
<td>Graphite + Gold</td> | |
<td>Black</td> | |
<td colspan="2">Black, White</td> | |
</tr> | |
<tr> | |
<td>Included cover</td> | |
<td>No - it is waterproof</td> | |
<td colspan="3">No</td> | |
</tr> | |
<tr> | |
<td>Battery life</td> | |
<td colspan="4">Weeks on a single charge</td> | |
</tr> | |
<tr> | |
<td>Weight</td> | |
<td>194g</td> | |
<td>Wi-Fi: 180g | |
<br>Wi-Fi + 3G: 188g</td> | |
<td>Wi-Fi: 205g | |
<br>Wi-Fi + 3G: 217g</td> | |
<td>161g</td> | |
</tr> | |
</tbody> | |
<tfoot> | |
<tr> | |
<td colspan="5" id="bottom-cap">*Optional</td> | |
</tr> | |
</tfoot> | |
</table> | |
</div> | |
</section> | |
<section id="pricing-section"> | |
<p class="section-title">Pricing</p> | |
<div class="cards-container"> | |
<div class="card-box"> | |
<img src="https://res.cloudinary.com/dzlmilfku/image/upload/v1530331803/oasis_lobreh.jpg" alt="Kindle Oasis" class="card-img"> | |
<div class="card-caption"> | |
<span>Kindle Oasis: $249,99</span> | |
</div> | |
</div> | |
<div class="card-box"> | |
<img src="https://res.cloudinary.com/dzlmilfku/image/upload/v1530331803/voyage_zsoyi3.jpg" alt="Kindle Voyage" class="card-img"> | |
<div class="card-caption"> | |
<span>Kindle Voyage: $189,99</span> | |
</div> | |
</div> | |
<div class="card-box"> | |
<img src="https://res.cloudinary.com/dzlmilfku/image/upload/v1530331803/paperwhite_llxfcm.jpg" alt="Kindle Paperwhite 3" class="card-img"> | |
<div class="card-caption"> | |
<span>Kindle Paperwhite: $129.99</span> | |
</div> | |
</div> | |
<div class="card-box"> | |
<img src="https://res.cloudinary.com/dzlmilfku/image/upload/v1530331803/kindle-basic_hvxeaw.jpg" alt="Kindle Basic" class="card-img"> | |
<div class="card-caption"> | |
<span>Kindle: $79.99</span> | |
</div> | |
</div> | |
</div> | |
</section> | |
<section id="order-section"> | |
<div class="parallax-bottom"> | |
<div id="order-form-container"> | |
<div> | |
<p id="get-yours">Get yours!</p> | |
</div> | |
<form id="form" action="https://www.freecodecamp.com/email-submit"> | |
<br> | |
<input type="email" name="email" id="email" placeholder="Enter your email address" required> | |
<br> | |
<input type="submit" value="Submit" id="submit"> | |
</form> | |
</div> | |
</div> | |
</section> | |
</main> | |
<footer id="about"> | |
<p> | |
This Product page was coded by <a class="footer-link" href="https://github.com/ValentinTapiaTorti" target="_blank"> Valentin TT</a>. | |
</p> | |
<p>More information about Kindle e-reader in its official <a class="footer-link" href="https://www.amazon.com/b/?ie=UTF8&node=6669702011&ref=spkl_1_0_9cb0811e-d3f7-4d61-ab5f-85d5cf81b211&qid=1530386452&pf_rd_p=9cb0811e-d3f7-4d61-ab5f-85d5cf81b211&pf_rd_m=ATVPDKIKX0DER&pf_rd_t=301&pf_rd_s=desktop-auto-sparkle&pf_rd_r=2BP9NYRNGRPF8GZT1SSE&pf_rd_i=kindle" | |
target="_blank">website</a> . | |
</p> | |
</footer> |
Responsive Web Design Projects - Build a Product Landing Page at freecodecamp.com
A Pen by Valentin TT on CodePen.
@import url("https://fonts.googleapis.com/css?family=Playfair+Display"); | |
:root { | |
--bg-nav-bar: #141414; | |
--nav-link-color: #cbbdb4; | |
--nav-link-hover-color: #f5f4f3; | |
--nav-link-underline-color: #00bb97; | |
--title-color: #fffefd; | |
--bg-description-section: #f6f6f6; | |
--description-section-color: #111111; | |
--bg-comparison-section: #d6c8bf; | |
--comparison-section-color: #111111; | |
--bg-comparison-table: #d6d6d6; | |
--bg-comparison-table-tr-even: #bcbcbc; | |
--bg-comparison-table-th: #636363; | |
--comparison-table-color: #1a1a1a; | |
--comparison-table-th-color: #f6f6f6; | |
--comparison-table-border-color: #969696; | |
--bg-comparison-table-tr-hover: rgb(165, 165, 165); | |
--bg-pricing-section: #fff; | |
--pricing-section-color: #1a1a1a; | |
--bg-card-caption-box: #000000; | |
--card-caption-color: #fff; | |
--bg-order-section: #fff; | |
--email-border-color: #555770; | |
--bg-submit: #584944; | |
--submit-color: #fff; | |
--bg-submit-hover: #8a7b75; | |
--bg-footer: #141414; | |
--font-color: #cbbdb4; | |
--footer-link-underline-color: #00bb97; | |
--footer-link-hover-color: #584944; | |
--footer-link-color: #8a7b75; | |
} | |
body, | |
html { | |
box-sizing: border-box; | |
margin: 0; | |
padding: 0; | |
max-width: 100vw; | |
height: 100vh; | |
font-family: "Roboto Slab", serif; | |
} | |
.parallax-top { | |
height: 100vh; | |
background-image: url("http://res.cloudinary.com/dzlmilfku/image/upload/v1530322675/kindle-oasis-lead_hbqcse.jpg"); | |
background-attachment: fixed; | |
background-position: center; | |
background-repeat: no-repeat; | |
background-size: cover; | |
} | |
.title-container { | |
height: 100vh; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background: rgba(0, 0, 0, 0.329); | |
} | |
h1 { | |
color: var(--title-color, white); | |
font-size: 3rem; | |
text-align: center; | |
} | |
#nav-bar { | |
box-sizing: border-box; | |
width: 100vw; | |
margin: 0; | |
padding: 1rem; | |
padding-bottom: 0.5rem; | |
padding-right: 2rem; | |
position: fixed; | |
top: 0; | |
left: 0; | |
background: var(--bg-nav-bar, #000); | |
z-index: 1000; | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: flex-end; | |
} | |
.nav-link { | |
margin: 0 5px; | |
list-style-type: none; | |
color: var(--nav-link-color, #fff); | |
text-decoration: none; | |
transition: color 0.3s ease-in-out; | |
font-size: 1.3rem; | |
position: relative; | |
} | |
.nav-link::before { | |
content: ""; | |
background: var(--nav-link-underline-color, #00bb97); | |
width: 0; | |
height: 3px; | |
position: absolute; | |
bottom: 0; | |
transition: width 0.5s ease-out; | |
} | |
.nav-link:hover::before { | |
width: 100%; | |
} | |
.nav-link:hover { | |
color: var(--nav-link-hover-color, #fff); | |
} | |
#description-section { | |
background: var(--bg-description-section, white); | |
padding: 1rem; | |
padding-top: 0; | |
padding-bottom: 3rem; | |
color: var(--description-section-color, #fff); | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
} | |
.section-title { | |
padding: 2.25rem 0; | |
padding-top: 3rem; | |
margin: 0; | |
text-align: center; | |
font-size: 2rem; | |
} | |
.characteristics-container { | |
display: grid; | |
grid-template-columns: repeat(2, 1fr); | |
margin-bottom: 5rem; | |
grid-column-gap: 10px; | |
} | |
.characteristic { | |
margin-top: 5px; | |
} | |
.characteristic-title { | |
padding: 0 5px; | |
margin: 0; | |
margin-top: 5px; | |
margin-bottom: 5px; | |
font-weight: bold; | |
} | |
.characteristic-body { | |
padding: 0 5px; | |
margin: 0; | |
text-align: justify; | |
} | |
.video-container { | |
box-sizing: border-box; | |
position: relative; | |
padding-bottom: 56.25%; | |
/* 16:9 */ | |
height: 0; | |
} | |
.video-container iframe { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} | |
#comparison-section { | |
background: var(--bg-comparison-section, #fff); | |
color: var(--comparison-section-color, #fff); | |
padding-bottom: 3rem; | |
} | |
.table-container { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
.comparison-table { | |
width: 100vw; | |
padding: 0 1rem; | |
margin: 0 1rem; | |
color: var(--comparison-table-color, #000); | |
background: var(--bg-comparison-table, #fff); | |
border: 0; | |
border-collapse: collapse; | |
} | |
.comparison-table th { | |
border: 1px solid var(--bg-comparison-table-th, #fff); | |
} | |
.comparison-table td { | |
/* border: 1px solid var(--comparison-table-border-color, #fff); | |
border-top: 0; | |
border-bottom: 0; */ | |
border: 0; | |
padding: 8px; | |
} | |
.comparison-table td { | |
text-align: center; | |
} | |
.comparison-table td:first-child { | |
text-align: left; | |
} | |
.comparison-table th { | |
padding-top: 12px; | |
padding-bottom: 12px; | |
text-align: center; | |
background-color: var(--bg-comparison-table-th, #fff); | |
color: var(--comparison-table-th-color, #fff); | |
} | |
.comparison-table tr:nth-child(even) { | |
background-color: var(--bg-comparison-table-tr-even, #fff); | |
} | |
.comparison-table tr:hover { | |
background-color: var(--bg-comparison-table-tr-hover, #fff); | |
} | |
.comparison-table tr:hover td:first-of-type { | |
border-left-color: var(--bg-comparison-table-tr-hover, #fff); | |
} | |
.comparison-table tr:hover td:last-of-type { | |
border-right-color: var(--bg-comparison-table-tr-hover, #fff); | |
} | |
.comparison-table #bottom-cap { | |
text-align: center; | |
font-style: italic; | |
} | |
#pricing-section { | |
background: var(--bg-pricing-section, #fff); | |
max-width: 100vw; | |
padding: 0; | |
padding-bottom: 4rem; | |
color: var(--pricing-section-color, #000); | |
} | |
#pricing-section p { | |
font-size: 3rem; | |
} | |
.cards-container { | |
display: flex; | |
align-items: center; | |
justify-content: space-around; | |
flex-wrap: wrap; | |
} | |
.card-box { | |
position: relative; | |
overflow: hidden; | |
width: 250px; | |
height: 250px; | |
margin: 10px; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background: #fff; | |
} | |
.card-img { | |
max-width: 250px; | |
height: auto; | |
-webkit-transition: all 0.2s ease-out; | |
-moz-transition: all 0.2s ease-out; | |
-o-transition: all 0.2s ease-out; | |
-ms-transition: all 0.2s ease-out; | |
transition: all 0.2s ease-out; | |
} | |
.card-caption { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
bottom: 0%; | |
z-index: 100; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background: var(--bg-card-caption-box, black); | |
color: var(--card-caption-color, #fff); | |
opacity: 0; | |
-webkit-transition: all 0.2s ease-out; | |
-moz-transition: all 0.2s ease-out; | |
-o-transition: all 0.2s ease-out; | |
-ms-transition: all 0.2s ease-out; | |
transition: all 0.2s ease-out; | |
} | |
.card-box:hover .card-caption { | |
opacity: 0.8; | |
} | |
.card-box:hover .card-img { | |
-moz-transform: scale(1.4); | |
-o-transform: scale(1.4); | |
-webkit-transform: scale(1.4); | |
transform: scale(1.4); | |
} | |
#order-section { | |
height: 100vh; | |
} | |
.parallax-bottom { | |
position: initial; | |
height: 100vh; | |
background-image: url("http://res.cloudinary.com/dzlmilfku/image/upload/v1530328738/Kindle_Oasis_Hero03_US_Store_CMYK_qzu3hn.jpg"); | |
background-attachment: fixed; | |
background-position: center; | |
background-repeat: no-repeat; | |
background-size: cover; | |
} | |
#order-form-container { | |
height: 100vh; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
flex-direction: column; | |
background: rgba(0, 0, 0, 0.5); | |
} | |
#get-yours { | |
width: 100%; | |
margin: 0; | |
text-align: center; | |
font-size: 3rem; | |
padding-bottom: 2rem; | |
color: var(--bg-order-section, #fff); | |
} | |
form { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
flex-direction: column; | |
} | |
#email { | |
border: 0; | |
outline: none; | |
display: block; | |
width: 100%; | |
margin-top: 1em; | |
padding: 5px 0; | |
border-radius: 5px; | |
padding-left: 10px; | |
border: 2px solid transparent; | |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); | |
font-size: 1rem; | |
} | |
#email:focus { | |
border: 2px solid var(--email-border-color, white); | |
} | |
#submit { | |
background-color: var(--bg-submit, #f00); | |
color: var(--submit-color, #fff); | |
border: 0; | |
border-radius: 5%; | |
padding: 1rem; | |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); | |
transition: box-shadow 0.2s ease-in-out; | |
transition: background-color 0.2s ease-in-out; | |
font-size: 15px; | |
} | |
#submit:active, | |
#submit:hover { | |
outline: none; | |
border: 0; | |
background-color: var(--bg-submit-hover, #fff); | |
} | |
#submit:active { | |
box-shadow: 0; | |
} | |
footer { | |
background: var(--bg-footer, white); | |
padding: 1rem 0; | |
color: var(--font-color, #fff); | |
} | |
footer p { | |
margin: 0; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
.footer-link { | |
padding-left: 5px; | |
text-decoration: none; | |
outline: none; | |
color: var(--footer-link-color, #ee1828); | |
transition: all 0.2s ease-in; | |
display: inline-block; | |
text-decoration: none; | |
transition: color 0.5s ease-out; | |
position: relative; | |
} | |
.footer-link::before { | |
content: ""; | |
background: var(--footer-link-underline-color, #00bb97); | |
width: 0; | |
height: 3px; | |
position: absolute; | |
bottom: 0; | |
transition: width 0.5s ease-out; | |
} | |
.footer-link:hover::before { | |
width: 100%; | |
} | |
.footer-link:active, | |
.footer-link:hover { | |
text-decoration: none; | |
outline: none; | |
color: var(--footer-link-hover-color, #000); | |
} | |
@media only screen and (max-width: 768px) { | |
.parallax-top, | |
.parallax-bottom { | |
background-attachment: scroll; | |
background-size: 100% 100%; | |
} | |
} | |
@media (max-width: 575.98px) { | |
.characteristics-container { | |
grid-template-columns: 1fr; | |
grid-template-rows: repeat(6, auto); | |
grid-column-gap: 0; | |
} | |
} |