Created
January 30, 2024 14:10
-
-
Save viniciusalves23/09ccb9c95f397b9b4ea5efdb98d6dfa1 to your computer and use it in GitHub Desktop.
Price comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="price-comparison"> | |
<div class="price-column"> | |
<div class="price-header"> | |
<div class="price-amount"> | |
<div class="price-amount__currency">$</div> | |
<div class="price-amount__amount">10</div> | |
<div class="price-amount__per-month">/mo</div> | |
</div> | |
<div class="plan-name">Basic</div> | |
</div> | |
<div class="divider"></div> | |
<div class="feature">Feature A</div> | |
<div class="feature">Feature B</div> | |
<div class="feature inactive">Feature C</div> | |
<div class="feature inactive">Feature D</div> | |
<div class="feature inactive">Feature E</div> | |
<button class="call-to-action">Start Today</button> | |
</div> | |
<div class="price-column popular"> | |
<div class="most-popular">Most Popular</div> | |
<div class="price-header"> | |
<div class="price-amount"> | |
<div class="price-amount__currency">$</div> | |
<div class="price-amount__amount">20</div> | |
<div class="price-amount__per-month">/mo</div> | |
</div> | |
<div class="plan-name">Professional</div> | |
</div> | |
<hr class="divider" /> | |
<div class="feature">Feature A</div> | |
<div class="feature">Feature B</div> | |
<div class="feature">Feature C</div> | |
<div class="feature">Feature D</div> | |
<div class="feature inactive">Feature E</div> | |
<button class="call-to-action">Start Today</button> | |
</div> | |
<div class="price-column"> | |
<div class="price-header"> | |
<div class="price-amount"> | |
<div class="price-amount__currency">$</div> | |
<div class="price-amount__amount">50</div> | |
<div class="price-amount__per-month">/mo</div> | |
</div> | |
<div class="plan-name">Enterprise</div> | |
</div> | |
<div class="divider"></div> | |
<div class="feature">Feature A</div> | |
<div class="feature">Feature B</div> | |
<div class="feature">Feature C</div> | |
<div class="feature">Feature D</div> | |
<div class="feature">Feature E</div> | |
<button class="call-to-action">Start Today</button> | |
</div> | |
</section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(https://fonts.googleapis.com/css?family=Poppins|Lato); | |
$color-accent: #641bff; | |
$color-secondary: #740AD1; | |
$color-icon: #0ce67d; | |
$color-black: #414244; | |
$color-light: #fff; | |
$color-background: #f8f9fb; | |
$color-gradient: linear-gradient(155deg, $color-accent, $color-secondary); | |
$font-header: "Poppins", sans-serif; | |
$font-body: "Lato", sans-serif; | |
$padding-card: 2rem; | |
$margin-card-popular: 1.5rem; | |
$margin-icon: 1.1em; | |
$border-radius-card: 0.5rem; | |
$box-shadow: 0 7px 30px rgba(52, 31, 97, 0.1); | |
$box-shadow-popular: 0 7px 30px rgba(52, 13, 135, 0.3); | |
*, | |
*::before, | |
*::after { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
:root { | |
font-size: 18px; | |
} | |
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
width: 100vw; | |
height: 100vh; | |
font-family: $font-body; | |
color: $color-black; | |
background: $color-background; | |
} | |
.price-comparison { | |
display: flex; | |
justify-content: center; | |
align-items: stretch; | |
width: 100%; | |
margin: 1rem; | |
} | |
.price-column { | |
flex: 1 1 auto; | |
max-width: 275px; | |
padding: $padding-card; | |
background: $color-light; | |
border-radius: $border-radius-card; | |
box-shadow: $box-shadow; | |
&:first-child { | |
border-top-right-radius: 0; | |
border-bottom-right-radius: 0; | |
} | |
&:last-child { | |
border-top-left-radius: 0; | |
border-bottom-left-radius: 0; | |
} | |
} | |
.price-header { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
font-family: $font-header; | |
font-weight: bold; | |
} | |
.price-amount { | |
display: flex; | |
font-size: 3.5rem; | |
&__currency { | |
margin-top: 0.5rem; | |
margin-right: 0.25rem; | |
font-size: 1.5rem; | |
} | |
&__per-month { | |
margin-bottom: 0.75rem; | |
align-self: flex-end; | |
font-size: 0.75rem; | |
text-transform: uppercase; | |
} | |
} | |
.plan-name { | |
margin-top: 1rem; | |
font-size: 0.85rem; | |
text-transform: uppercase; | |
} | |
.divider { | |
margin-top: 1rem; | |
margin-bottom: 2rem; | |
height: 1px; | |
width: 100%; | |
background: currentColor; | |
opacity: 0.2; | |
} | |
.feature { | |
position: relative; | |
margin: 0.5rem; | |
margin-left: $margin-icon + 0.5em; | |
&::before { | |
content: ""; | |
position: absolute; | |
top: 0; left: 0; | |
width: $margin-icon; height: $margin-icon; | |
margin-left: $margin-icon * -1 - 0.5em; | |
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0%0D%0APSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwQ0U2N0QiIHN0%0D%0Acm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJv%0D%0AdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZWNrLWNpcmNsZSI+PHBhdGggZD0iTTIyIDEx%0D%0ALjA4VjEyYTEwIDEwIDAgMSAxLTUuOTMtOS4xNCI+PC9wYXRoPjxwb2x5bGluZSBwb2ludHM9IjIy%0D%0AIDQgMTIgMTQuMDEgOSAxMS4wMSI+PC9wb2x5bGluZT48L3N2Zz4="); | |
background-size: 1.1em; | |
} | |
&.inactive { | |
opacity: 0.4; | |
text-decoration-line: line-through; | |
filter: grayscale(0.5); | |
&::before { | |
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0%0D%0APSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNlODgxNjEiIHN0%0D%0Acm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJv%0D%0AdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgtc3F1YXJlIj48cmVjdCB4PSIzIiB5PSIzIiB3%0D%0AaWR0aD0iMTgiIGhlaWdodD0iMTgiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PjxsaW5lIHgxPSI5IiB5%0D%0AMT0iOSIgeDI9IjE1IiB5Mj0iMTUiPjwvbGluZT48bGluZSB4MT0iMTUiIHkxPSI5IiB4Mj0iOSIg%0D%0AeTI9IjE1Ij48L2xpbmU+PC9zdmc+"); | |
background-size: 1.1em; | |
} | |
} | |
} | |
.call-to-action { | |
width: 100%; | |
margin-top: 3rem; | |
padding: 0.75em 1em; | |
font-family: $font-header; | |
font-size: 0.75rem; | |
font-weight: bold; | |
color: $color-light; | |
text-transform: uppercase; | |
background: $color-gradient; | |
border: 0; | |
border-radius: 0.25rem; | |
box-shadow: $box-shadow; | |
cursor: pointer; | |
transform: scale(1); | |
transition: transform 100ms ease-in-out; | |
&:hover, &:focus { | |
transform: scale(0.95); | |
} | |
} | |
.popular { | |
position: relative; | |
margin-top: $margin-card-popular * -1; | |
padding-top: $margin-card-popular + $padding-card; | |
margin-bottom: $margin-card-popular * -1; | |
padding-bottom: $margin-card-popular + $padding-card; | |
background: $color-gradient; | |
color: $color-light; | |
box-shadow: $box-shadow-popular; | |
.most-popular { | |
position: absolute; | |
top: 2rem; | |
left: 0rem; | |
right: 0rem; | |
z-index: 1; | |
margin: -2rem 0; | |
padding-top: 1rem; | |
padding-bottom: 0.5rem; | |
font-family: $font-header; | |
font-weight: bold; | |
text-align: center; | |
text-transform: uppercase; | |
&::before { | |
content: ""; | |
position: absolute; | |
top: 0; left: 0; | |
z-index: -1; | |
width: 100%; height: 100%; | |
background: $color-secondary; | |
border-top-left-radius: $border-radius-card; | |
border-top-right-radius: $border-radius-card; | |
opacity: 0.85; | |
} | |
} | |
.call-to-action { | |
background: $color-light; | |
font-size: 0.85rem; | |
color: $color-accent; | |
box-shadow: $box-shadow-popular; | |
} | |
} | |
@media screen and (max-width: 632px) { | |
:root { | |
font-size: 16px; | |
} | |
body { | |
align-items: flex-start; | |
} | |
.price-comparison { | |
flex-flow: column wrap; | |
justify-content: flex-start; | |
align-items: center; | |
} | |
.price-column { | |
width: 72%; | |
max-width: 80%; | |
&:first-child { | |
border-top-right-radius: $border-radius-card; | |
border-bottom-left-radius: 0; | |
} | |
&:last-child { | |
border-top-right-radius: 0; | |
border-bottom-left-radius: $border-radius-card; | |
} | |
} | |
.feature { | |
justify-content: center; | |
font-size: 1.25em; | |
} | |
.popular { | |
width: 100%; | |
margin: 0; | |
padding: $padding-card; | |
.price-header { | |
margin-top: 2rem; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comparação de Preços