A Pen by Giovanni Orlando on CodePen.
Created
April 14, 2017 18:24
-
-
Save gorlandor/77bafef1e04fbade06498d2e2248e6b1 to your computer and use it in GitHub Desktop.
Hamburger
This file contains 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
<div class="wrapper flex-vertically"> | |
<h1>Hamburger</h1> | |
<div class="burger"> | |
<div class="bread bread--top"></div> | |
<div class="lettuce"></div> | |
<div class="tomato"></div> | |
<div class="cheese"></div> | |
<div class="meat"></div> | |
<div class="cheese"></div> | |
<div class="meat"></div> | |
<div class="bread bread--bottom"></div> | |
</div> | |
</div> |
This file contains 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
* { | |
box-sizing: border-box; | |
} | |
html, | |
body { | |
width: 100%; | |
height: 100%; | |
min-height: 100vh; | |
margin: 0; | |
padding: 0; | |
border: none; | |
background-color: green; | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: 500; | |
color: white; | |
text-align: center; | |
} | |
.flex-vertically { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
} | |
.wrapper { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
border: none; | |
} | |
.lettuce { | |
width: 290px; | |
height: 10px; | |
margin: 0 auto; | |
border: 2px solid black; | |
border-radius: 2px; | |
background-image: repeating-linear-gradient( 180deg, green 0%, green 25%, lightgreen 25%, lightgreen 50%, green 50%, green 75%, lightgreen 75%, lightgreen 100%); | |
} | |
.tomato { | |
width: 280px; | |
height: 15px; | |
margin: 0 auto; | |
border: 2px solid black; | |
background-image: repeating-linear-gradient( 180deg, crimson 0%, crimson 25%, red 25%, red 50%, crimson 50%, crimson 75%, red 75%, red 100%); | |
} | |
.cheese { | |
width: 285px; | |
height: 8px; | |
margin: 0 auto; | |
border: 1px solid black; | |
border-radius: 2px; | |
background-image: repeating-linear-gradient( 180deg, yellow 0%, yellow 25%, red 25%, red 50%, yellow 50%, yellow 75%, red 75%, red 100%); | |
} | |
.meat { | |
width: 280px; | |
height: 20px; | |
margin: 0 auto; | |
border: 2px solid black; | |
background: radial-gradient(black 15%, transparent 16%), saddlebrown; | |
background-size: 33px 13px; | |
border-radius: 4px; | |
} | |
.bread { | |
width: 300px; | |
height: 40px; | |
margin: 0 auto; | |
border: 2px solid black; | |
background: radial-gradient(navajowhite 5%, transparent 6%), sandybrown; | |
background-size: 60px 30px; | |
} | |
.bread--top { | |
height: 50px; | |
border-top-left-radius: 50%; | |
border-top-right-radius: 50%; | |
border-bottom-left-radius: 5%; | |
border-bottom-right-radius: 5%; | |
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5); | |
} | |
.bread--bottom { | |
border-bottom-left-radius: 50%; | |
border-bottom-right-radius: 50%; | |
border-top-left-radius: 5%; | |
border-top-right-radius: 5%; | |
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment