A Pen by Giovanni Orlando on CodePen.
Created
April 14, 2017 03:11
-
-
Save gorlandor/29378da84ad6356beadaa6263475dd0e to your computer and use it in GitHub Desktop.
Pencil Jar
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
<div class="flex-container flex-vertically"> | |
<h1>Pencil Jar</h1> | |
<div class="pencil-jar-top"></div> | |
<div class="pencil-jar-holder flex-horizontally"> | |
<div class="pencil pencil--size-small flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-medium flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-large flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-venti flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-small flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-medium flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-large flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
<div class="pencil pencil--size-venti flex-vertically"> | |
<div class="top"></div> | |
<div class="core"></div> | |
<div class="tip"></div> | |
<div class="lead"></div> | |
</div> | |
</div> | |
</div> |
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
html, | |
body { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
border: none; | |
background-color: dodgerblue; | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: 500; | |
font-size: 1rem; | |
color: white; | |
text-align: center; | |
} | |
.flex-container { | |
width: 100%; | |
height: 100%; | |
} | |
.flex-vertically { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
} | |
.flex-horizontally { | |
display: flex; | |
flex-direction: row; | |
align-items: flex-end; | |
justify-content: center; | |
} | |
.pencil-jar-top { | |
width: 260px; | |
height: 40px; | |
margin: 0 auto; | |
border: 2px solid black; | |
border-radius: 10px; | |
background-color: powderblue; | |
opacity: 0.75; | |
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6); | |
} | |
.pencil-jar-holder { | |
width: 240px; | |
height: 320px; | |
margin: 0 auto; | |
border: 2px solid black; | |
border-bottom-left-radius: 10px; | |
border-bottom-right-radius: 10px; | |
background-color: powderblue; | |
opacity: 0.5; | |
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6); | |
} | |
.pencil { | |
margin: 2px; | |
} | |
.pencil .top { | |
width: 16px; | |
height: 16px; | |
border: 2px solid black; | |
background-color: crimson; | |
} | |
.pencil .core { | |
width: 16px; | |
height: 200px; | |
border: 2px solid black; | |
background-color: yellow; | |
} | |
.pencil .tip { | |
border-top: 20px solid antiquewhite; | |
border-right: 10px solid transparent; | |
border-left: 10px solid transparent; | |
} | |
.pencil .lead { | |
border-top: 10px solid black; | |
border-right: 5px solid transparent; | |
border-left: 5px solid transparent; | |
position: relative; | |
bottom: 10px; | |
} | |
.pencil--size-small .core { | |
height: 140px; | |
} | |
.pencil--size-medium .core { | |
height: 180px; | |
} | |
.pencil--size-large .core { | |
height: 200px; | |
} | |
.pencil--size-venti .core { | |
height: 220px; | |
} | |
.pencil--size-small { | |
transform: rotate(-6deg); | |
} | |
.pencil--size-medium { | |
transform: rotate(-3deg); | |
} | |
.pencil--size-venti { | |
transform: rotate(2deg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment