Skip to content

Instantly share code, notes, and snippets.

@gorlandor
Last active March 6, 2017 06:01
Show Gist options
  • Save gorlandor/16d3f2d1d278b4d36073600b8983f137 to your computer and use it in GitHub Desktop.
Save gorlandor/16d3f2d1d278b4d36073600b8983f137 to your computer and use it in GitHub Desktop.
Beaver
<div class="beaver flex-vertically">
<div class="face flex-vertically">
<div class="ears flex-horizontally">
<div class="ear left-ear flex-vertically">
<div class="ear-inner left-ear"></div>
</div>
<div class="ear right-ear flex-vertically">
<div class="ear-inner right-ear"></div>
</div>
</div>
<div class="eyes flex-horizontally">
<div class="eye left-eye flex-vertically">
<div class="retina"></div>
</div>
<div class="eye right-eye flex-vertically">
<div class="retina"></div>
</div>
</div>
<div class="nose"></div>
<div class="mouth">
<div class="teeth flex-horizontally">
<div class="tooth left-tooth"></div>
<div class="tooth right-tooth"></div>
</div>
</div>
</div>
<div class="body flex-vertically">
<div class="arms flex-horizontally">
<div class="arm left-arm"></div>
<div class="arm right-arm"></div>
</div>
<div class="stomach"></div>
<div class="legs flex-horizontally">
<div class="leg left-leg"></div>
<div class="leg right-leg"></div>
</div>
</div>
<div class="tail"></div>
</div>
:root {
--primary-color: #b69b4c;
--secondary-color: #825201;
--tertiary-color: #deb887;
}
* {
box-sizing: border-box;
}
.flex-vertically {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.flex-horizontally {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
html,
body {
width: 100%;
height: 100vh;
margin: 0;
padding: 0;
border: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.beaver {
width: 100%;
height: 100vh;
margin: 0;
padding: 0;
border: none;
background-color: rebeccapurple;
}
.face {
width: 152px;
height: 152px;
border-radius: 76px;
background-color: var(--primary-color);
position: relative;
bottom: -3em;
border: 2px solid var(--secondary-color);
z-index: 2;
}
.ears {
padding-bottom: 0.5em;
}
.ear {
width: 64px;
height: 64px;
border-radius: 32px;
background-color: var(--primary-color);
}
.ear-inner {
width: 2em;
height: 2em;
border: 1px solid black;
border-top-left-radius: 1em;
border-top-right-radius: 1em;
background-color: var(--secondary-color);
transform: rotate(180deg);
}
.ear-inner.left-ear {
border-bottom-left-radius: 1em;
}
.ear-inner.right-ear {
border-bottom-right-radius: 1em;
}
.ear.left-ear {
border-top: 2px solid var(--secondary-color);
border-left: 2px solid var(--secondary-color);
margin-right: 1em;
}
.ear.right-ear {
border-top: 2px solid var(--secondary-color);
border-right: 2px solid var(--secondary-color);
margin-left: 1em;
}
.eyes {
padding-bottom: 0.5em;
position: relative;
bottom: 1.3em;
}
.eye {
width: 4em;
height: 4em;
border-radius: 2em;
background-color: white;
border: 1px solid black;
}
.retina {
width: 2.2em;
height: 2.2em;
border-radius: 1.1em;
background-color: black;
}
.nose {
width: 1.5em;
height: 1.5em;
background-color: black;
border-bottom-left-radius: 0.75em;
border-bottom-right-radius: 0.75em;
}
.mouth {
padding-top: 0.5em;
}
.teeth {}
.tooth {
width: 1em;
height: 1em;
background-color: white;
border: 1px solid black;
}
.tooth.left-tooth {
border-bottom-left-radius: 0.5em;
}
.tooth.right-tooth {
border-bottom-right-radius: 0.5em;
}
.body {
width: 192px;
height: 192px;
border-radius: 120px;
background-color: var(--primary-color);
border: 2px solid var(--secondary-color);
z-index: 1;
}
.arms {}
.arm {
width: 3em;
height: 4em;
border-radius: 1.5em;
border: 2px solid var(--secondary-color);
background-color: var(--primary-color);
position: relative;
top: 2.3em;
}
.arm.left-arm {
transform: rotate(60deg);
margin-right: 2.4em;
}
.arm.right-arm {
transform: rotate(-60deg);
margin-left: 2.4em;
}
.stomach {
width: 128px;
height: 128px;
border-radius: 64px;
border: 1px solid black;
position: relative;
bottom: -1.5em;
background-color: var(--tertiary-color);
}
.legs {}
.leg {
width: 3em;
height: 4em;
border-radius: 1.5em;
border: 2px solid var(--secondary-color);
background-color: var(--primary-color);
}
.leg.left-leg {
margin-right: 1em;
transform: rotate(-35deg);
}
.leg.right-leg {
margin-left: 1em;
transform: rotate(35deg);
}
.tail {
width: 3em;
height: 8em;
border-radius: 1.5em;
background-color: var(--secondary-color);
transform: rotate(75deg);
position: relative;
left: 7em;
bottom: 7em;
z-index: 0;
border: 1px solid black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment